【发布时间】:2018-06-02 12:17:52
【问题描述】:
我是否这样做
Vue.router.push({ path: '/beats/catalog/1' })
或者这个
Vue.router.push({ name: 'BeatsCatalog', params: { page: 1 } })
我得到相同的结果:
[vue-router] missing param for named route "BeatsCatalog": Expected "page" to be defined.
路由器:
{
path: '/beats',
components: {
navbar: Navbar,
default: { template: `<router-view/>` }
},
children: [{
name: 'BeatsCatalog',
path: 'catalog/:page',
components: {
default: () => import('@/views/BeatsCatalog')
},
props: { default: true }
},
{
path: 'upload',
name: 'BeatsUpload',
components: {
default: () => import('@/views/BeatsUpload')
}
},
],
meta: { requiresAuth: true }
}
导致问题的原因是什么?我的设置没有任何问题,我正在做文档中的所有事情。 谢谢。
【问题讨论】:
标签: vue.js vue-router vuex