nuxt-router-module
v0.0.1-beta1
Published
## Features
Downloads
5
Readme
nuxt-router-module
Features
Disable nuxt built-in router configs(building router configs from pages directory).
You can use this module to load router configs automatically.
Installation
$ npm install nuxt-router-module
Setup
- module configuration
// nuxt.config.js
export default {
modules: [
[
'nuxt-router-module',
{
/* module options */
},
],
],
// or
routerModule: {
/* module options */
path: '~/routes',
fileName: 'index.js',
},
};
- routes configuration
// ~/routes/index.js
export default [
{
path: '/home',
component: Home,
// ... router configs
},
];
Options
path
Location of your route file
- Type:
string
- Default:
~
- Type:
fileName
File name of your routes configuration in
path
Must export valid Vue routes- Type:
string
- Default:
index.js
- Type:
routerOptions
Same as
vue-router
router options