DruxtRouterNuxtModule
DruxtRouterNuxtModule(moduleOptions)
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.
A Nuxt module configures the Nuxt application, and is unrelated to a Drupal module.
Kind: global function
See
| Param | Type | Description |
|---|---|---|
| moduleOptions | object | The Nuxt.js module options. |
Properties
| Name | Type | Default | Description |
|---|---|---|---|
| options.druxt | object | Druxt root level options. | |
| options.druxt.baseUrl | string | Base URL of the Drupal JSON:API backend. | |
| [options.druxt.endpoint] | string | "/jsonapi" | The Drupal JSON:API endpoint path. |
| [options.druxt.axios] | object | Axios settings for the DruxtRouter client. | |
| [options.druxt.proxy.api] | boolean | Proxy JSON:API requests on the client side. | |
| [options.druxt.router.render] | string | Name of the component used to render the resolved route. |
Example
// `nuxt.config.js`
module.exports = {
buildModules: ['druxt-router/nuxt'],
druxt: {
baseUrl: 'https://demo-api.druxtjs.org'
}
}