DruxtSchemaStore
DruxtSchemaStore
Vuex module, registered under the druxtSchema namespace.
The druxtSchema Vuex module.
Provides a Vuex state object, mutations and actions for interacting with the Druxt Schemas.
See: The DruxtStore
- druxtSchema
get(resource) ⇒ Schema
Get a schema.
Vuex Action => Mutates state propertyschema
Kind: action method of druxtSchema
Returns: Schema - The Druxt Schema object.
| Param | Type | Description |
|---|---|---|
| resource | SchemaConfiguration | The requested resource schema configuration object. |
Example
const schema = await this.$store.dispatch('druxtSchema/get', { resourceType: 'node--page' })
state : state
The Vuex State object.
addSchema
Kind: mutation method of druxtSchema
| Param | Type | Description |
|---|---|---|
| state | state | The Vuex State object. |
| data | addSchemaPayload | Schema object and ID to be committed. |
Example
this.$store.commit('druxtSchema/addSchema', { id, schema })
state : object
The Vuex State object.
Kind: global typedef
Properties
| Name | Type | Description |
|---|---|---|
| schemas | object | Druxt Schemas, keyed by Schema ID. |
addSchemaPayload : object
Parameters for the addSchema mutation.
Kind: global typedef
| Param | Type | Description |
|---|---|---|
| id | string | The Schema ID. |
| schema | object | The Schema object. |
Example
{
id: 'node--page--default--view',
schema: {}
}
Schema : object
The Druxt Schema object.
Kind: global typedef
See: Schema
SchemaConfiguration : object
Druxt Schema configuration object.
Kind: global typedef
See: SchemaConfiguration