1. druxt-router
Drupal router for Nuxt, powered by the Drupal Decoupled Router module.
druxt-router
Package: druxt-router
Created by: druxt
Last modified: Thu, 02 Nov 2023 01:56:32 GMT
Version: 0.31.0
License: MIT
Downloads: 1,077
Repository: https://github.com/druxt/druxt.js

Install

npm install druxt-router
yarn add druxt-router

DruxtJS Router

CircleCI
Known Vulnerabilities
codecov

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

  • DruxtJS: https://druxtjs.org
  • Documentation: https://druxtjs.org/modules/router
  • Community Discord server: https://discord.druxtjs.org

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/nuxt'],
  druxt: {
    baseUrl: 'https://demo-api.druxtjs.org'
  }
}

Options

Druxt Router options

These options are specific to this module.

Option Type Required Default Description
router.pages boolean No true Whether to parse the Nuxt pages/ directory.
router.wildcard boolean No true Whether to install the wildcard route.

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.

Dependencies

RELATED POST

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Enhancing Vue.js Development: Harnessing the Potential of Vue-Loader

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Simplify Data Validation in Vue.js: A Step-by-Step Guide to Using Regex

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Troubleshooting Made Easy: Common Issues and Solutions with vue-loader Without vue-cli

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Optimizing Webpack 4 with Vue CLI 3: Disabling the Cache-Loader

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin

Step-by-Step Guide: How to Add a Function to Your Vuex Plugin