Skip to content
druxt-breadcrumb

Breadcrumb

Render a breadcrumb trail in Nuxt from the Drupal decoupled router, with the DruxtBreadcrumb component and its theming options.

DruxtBreadcrumb

npm CI Known Vulnerabilities codecov

Decoupled Router based Breadcrumb Druxt component.

Install

$ npm install druxt-breadcrumb

Nuxt.js

Add module to nuxt.config.js

module.exports = {
  modules: ['druxt-breadcrumb'],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org',
  },
};

Usage

DruxtBreadcrumb component

The DruxtBreadcrumb component uses the Vue Router and DruxtRouter to build a list of crumbs.

<DruxtBreadcrumb />

The crumbs can be themed by providing a default scoped slot:

<DruxtBreadcrumb>
  <template #default="{ crumbs }">
    {{ crumbs }}
  </template>
</DruxtBreadcrumb>

The DruxtBreadcrumb also provide a DruxtWrapper component for theming:

<!-- DruxtBreadcrumbDefault.vue -->
<template>
  <div>
    <slot />
  <div>
</template>

See the DruxtBreadcrumb API documentation for more information.

Options

Base Druxt options

These options are available to all Druxt modules, in the nuxt.config.js file.

OptionTypeRequiredDefaultDescription
druxt.axiosobjectNo{}Axios instance settings.
druxt.baseUrlstringYesnullBase URL for the Drupal installation.

Note: The contents of this file were automatically generated from the packages/breadcrumb/README.md.