druxt-router

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

Usage no npm install needed!

<script type="module">
  import druxtRouter from 'https://cdn.skypack.dev/druxt-router';
</script>

README

DruxtJS Router

CircleCI Known Vulnerabilities codecov

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

Links

Features

  • Nuxt.js module with out of the box page routing: druxt-router
  • Vuex store: druxtRouter
  • Vue component: <DruxtRouter />
  • Vue mixin: DruxtRouterEntityMixin

Install

$ npm install druxt-router

Usage

Add module to nuxt.config.js

module.exports = {
  modules: [
    ...
    'druxt-router'
  ],

  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org'
  }
}

Ensure you have activated the Nuxt Vuex store.

Options

Base Druxt options

These options are available to all DruxtJS modules.

Option Type Required Default Description
axios object No {} Axios instance settings.
baseUrl string Yes null Base URL for the Drupal installation.
endpoint string No /jsonapi JSON:API Endpoint of the Drupal installation.