Skip to content

Drupal router for Nuxt, powered by the Drupal Decoupled Router module.

DruxtRouterNuxtModule

View source on GitHub

DruxtRouterNuxtModule()

The Nuxt.js module function.

  • Extends the Vue router, adding the Druxt wildcard route.
  • Adds the Druxt router plugin.
  • Adds the Druxt router Vuex store.

The module function should not be used directly, but rather installed via your Nuxt configuration file.

Options are set on the root level druxt Nuxt config object.

Kind: global function
Properties

NameTypeDescription
options.druxtobjectDruxt root level options.
options.druxt.baseUrlstringBase URL of Drupal JSON:API backend.
options.druxt.router.componentstringFile to custom Router component.

Example

// `nuxt.config.js`
module.exports = {
  buildModules: ['druxt-router/nuxt'],
  druxt: {
    baseUrl: 'https://demi-api.druxtjs.org'
  }
}