0.0.1-beta1 • Published 5 years ago
nuxt-router-module v0.0.1-beta1
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-moduleSetup
- 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
pathLocation of your route file
- Type:
string - Default:
~
- Type:
fileNameFile name of your routes configuration in
pathMust export valid Vue routes- Type:
string - Default:
index.js
- Type:
routerOptionsSame as
vue-routerrouter options
0.0.1-beta1
5 years ago