nuxt.config.js覆寫router:module.exports = {
router: {
base: '/',
routes: [
{ name: 'index', path: '/',
component: 'pages/index.vue'
},
{ name: 'test', path: '/test(.*?)?', //path: '/test(.*?)?',
component: 'pages/test'
},
{ name: 'testtwo', path: '/testtwo',
component: 'pages/testtwo'
}
],
}
}目的想配置可以解析路由上的任意多個params,但是:localhost:3000/test/1 就報找不到頁面,
nuxt.js 怎樣配置路由帶參?
慕森卡
2018-10-24 10:20:26