Skip to content

Drupal Display Mode-powered Entity, Form and Field Druxt components.

DruxtEntityFormButtons

View source on GitHub

DruxtEntityFormButtons

Used by the DruxtEntityForm component to render Druxt Wrapper themeable buttons.


.getScopedSlots() ⇒ object

Get scoped slots for Entity form buttons.

Kind: instance method of DruxtEntityFormButtons
Returns: object - Scoped slots for the submit and reset buttons, and a default slot rendering both.


.error(err, [context])

Sets the component to render a DruxtDebug error message.

Kind: instance method of DruxtEntityFormButtons

ParamTypeDescription
errobjectThe error object.
[context]objectError context; carries the wrapper component data where the failure knows it.

.getModuleComponents() ⇒ Components

Get list of module wrapper components.

Kind: instance method of DruxtEntityFormButtons


.getModulePropsData(wrapperProps) ⇒ object

Get module propsData via modules druxt.propsData() callback.

Kind: instance method of DruxtEntityFormButtons

ParamTypeDescription
wrapperPropsobjectProps registered by the Wrapper component.

Example

{
  $attrs: { entity: {}, fields: {}, langcode: 'en', schema: {} },
  props: { value: {} },
  propsData: { entity: {}, fields: {}, langcode: 'en', schema: {}, value: {} },
}

.getWrapperData(component) ⇒ WrapperData

Get wrapper component data.

Kind: instance method of DruxtEntityFormButtons

ParamTypeDescription
componentstringThe Wrapper component name.

.props

Kind: static property of DruxtEntityFormButtons


.schema : object

Drupal Field schema information.

Kind: static property of props


.langcode : string

The resource langcode.

Kind: static property of props
Example

@lang vue
<DruxtEntityFormButtons langcode="en" />

.v-model : mixed

The Vue.js v-model binding for the module.

Setting a value provides the module data directly, so the Drupal JSON:API fetch is skipped.

Kind: static property of props
Default:
Example

@lang vue
<template>
  <DruxtEntityFormButtons v-model="model" />
</template>

<script>
export default {
  data: () => ({ model: { foo: 'bar' } })
}
</script>

.wrapper : (boolean | object)

The wrapper component configuration.

Used to set the wrapper component, class, style and propsData.

Kind: static property of props
Default: () => undefined
Example

<DruxtEntityFormButtons
  :wrapper="{
    component: 'BCard',
    class: 'article-card',
    propsData: { noBody: true }
  }"
/>

.methods

Kind: static property of DruxtEntityFormButtons


.data(vm)

Kind: static method of DruxtEntityFormButtons

ParamTypeDescription
vmobjectThe component ViewModel.
vm.value*The module component model value.

Properties

NameTypeDescription
componentComponentDataThe wrapper component and propsData to be rendered.
model*The module component model value.

.fetch()

Loads the Druxt module data and applies a wrapper component as required.

Important: If your component has an existing fetch method, you must manually invoke the DruxtModule.fetch() hook.

Kind: static method of DruxtEntityFormButtons
Example (Manually invoking DruxtModule.fetch().)

import DruxtModule from 'druxt/components/DruxtModule.vue'
export default {
  name: 'DruxtCustomModule',
  extends: DruxtModule,
  async fetch() {
    await DruxtModule.fetch.call(this)
  },
  druxt: {
    componentOptions: () => ([['Default']]),
    propsData: ({ model }) => ({ value: model }),
  }
}

.lang(vm) ⇒ string

The current language code: the langcode prop if set, otherwise the route's langcode metadata.

Used by Druxt modules to fetch the correct resource translation.

Kind: static method of DruxtEntityFormButtons
Returns: string - The current language code.

ParamTypeDescription
vmobjectThe component ViewModel.
vm.langcodestringThe langcode prop.
vm.$routeobjectThe current route.

Inherited type definitions

Inherited from DruxtModule: ComponentData, Components, WrapperData.