API Documentation
DruxtBreadcrumb
Modules
- DruxtBreadcrumb
The DruxtBreadcrumb component renders a list of breadcrumbs based on the active route.
Typedefs
- ComponentOptions :
Array.<array>
Provides the available naming options for the Wrapper component.
- PropsData :
object
Provides propsData for use in the Wrapper component.
- ScopedSlots :
object
Provides scoped slots for use in the Wrapper component.
DruxtBreadcrumb
The DruxtBreadcrumb component renders a list of breadcrumbs based on the active route.
Example
<DruxtBreadcrumb />
Example
<DruxtBreadcrumb path="/node/1" />
Example (DruxtBreadcrumb Wrapper component boilerplate)
<template>
<DruxtDebug :json="crumbs" />
</template>
<script>
import { DruxtBreadcrumbMixin } from 'druxt-breadcrumb'
export default {
mixins: [DruxtBreadcrumbMixin]
}
Example (DruxtBreadcrumb with template injection)
<DruxtBreadcrumb>
<template #default="{ crumbs }">
<!-- Do whatever you want here -->
<DruxtDebug :json="crumbs" />
</template>
</DruxtBreadcrumb>
- DruxtBreadcrumb
- instance
- static
.fetchCrumbs()
Fetch Crumbs
Kind: instance method of DruxtBreadcrumb
.props
Kind: static property of DruxtBreadcrumb
boolean
.home : Show home crumb?
Kind: static property of props
Default: true
Example
<DruxtBreadcrumb :home="false" />
string
.path : The Decoupled router path.
If not set, the Vue router value will be used instead.
Kind: static property of props
Example
<DruxtBreadcrumb path="/node/1" />
.langcode
The resource langcode.
Kind: static property of props
Example
<DruxtBreadcrumb langcode="en" />
.v-model
The module component model value.
Used to bypass the Drupal JSON:API fetch, setting the module data directly.
Kind: static property of props
Example
<DruxtBreadcrumb v-model="{ foo: bar }" />
.wrapper
The wrapper component configuration.
Used to set the wrapper component, class, style and propsData.
Kind: static property of props
Example
<DruxtBreadcrumb
:wrapper="{
component: 'MyWrapper',
class: 'wrapper',
propsData: { foo: 'bar' }
}"
/>
.computed
Kind: static property of DruxtBreadcrumb
.crumbs
Kind: static property of computed
Properties
Name | Type | Description |
---|---|---|
crumbs | Array.<objects> | The Breadcrumbs. |
.watch
Kind: static property of DruxtBreadcrumb
.$route()
Updates crumbs on Route change.
Kind: static method of watch
.druxt
DruxtModule settings
Kind: static property of DruxtBreadcrumb
.template
Druxt development template tool configuration.
Kind: static property of druxt
ComponentOptions
.componentOptions(context) ⇒ Provides the available component naming options for the Druxt Wrapper.
Kind: static method of druxt
Param | Type | Description |
---|---|---|
context | object | The module component ViewModel. |
.fetchConfig()
Fetches the breadcrumbs.
Kind: static method of druxt
PropsData
.propsData(context) ⇒ Provides propsData for the DruxtWrapper.
Kind: static method of druxt
Param | Type | Description |
---|---|---|
context | object | The module component ViewModel. |
ScopedSlots
.slots() ⇒ Provides the scoped slots object for the Module render function.
The default
slot renders crumbs as a list of NuxtLink's.
Kind: static method of druxt
Returns: ScopedSlots
- The Scoped slots object.
Array.<array>
ComponentOptions : Provides the available naming options for the Wrapper component.
Kind: global typedef
Example
[
'DruxtBreadcrumb[Default][Langcode]',
'DruxtBreadcrumb[Default]',
]
Example
[
'DruxtBreadcrumbDefaultEn',
'DruxtBreadcrumbDefault',
]
object
PropsData : Provides propsData for use in the Wrapper component.
Kind: global typedef
Param | Type | Description |
---|---|---|
crumbs | Array.<objects> | The Breadcrumbs. |
value | Array.<objects> | The Breadcrumbs value. |
Example
{
crumbs: [{
text: 'Home',
to: '/',
}],
value: [{
text: 'Home',
to: '/',
}],
}
object
ScopedSlots : Provides scoped slots for use in the Wrapper component.
Kind: global typedef
Param | Type | Description |
---|---|---|
default | function | Crumbs as a list of NuxtLink's. |
Example (DruxtBreadcrumbDefault.vue)
<template>
<div>
<slot />
</div>
</template>