# Mixins

DruxtSchemaMixin

Lazy loads a schema into the Vuex State object.

# Functions

getSchema()

Maps druxtSchema/get Vuex action to this.getSchema.

# DruxtSchemaMixin

Lazy loads a schema into the Vuex State object.

Kind: global mixin
Todo

  • Add schemaType property to Mixin.

Example

<script>
// Import mixin.
import { DruxtSchemaMixin } from 'druxt-schema'

export default {
  name: 'CustomComponent',

  // Register mixin.
  mixins: [DruxtSchemaMixin],
}
</script>
1
2
3
4
5
6
7
8
9
10
11

Example

<!-- Render component with lazy loaded Default View mode Page schema. -->
<CustomComponent type="node--page" mode="default" />
1
2

# .props

Vue.js Properties.

Kind: static property of DruxtSchemaMixin


# .mode : string

The Drupal Display mode.

Kind: static property of props
Default: "default"


# .type : string

The JSON:API Resource type.

Kind: static property of props


# .methods

Vue.js methods.

Kind: static property of DruxtSchemaMixin


# .fetch()

Loads the Schema from the Vuex store.

Kind: static method of DruxtSchemaMixin


# .data()

Vue.js Data object.

Kind: static method of DruxtSchemaMixin
Properties

Name Type Description
schema object The Drupal Schema data.

# getSchema()

Maps druxtSchema/get Vuex action to this.getSchema.

Kind: global function