【发布时间】:2020-03-21 16:25:53
【问题描述】:
const routes = [
{
path: '/',
component: LogInView
},
{
path: '/store',
component: Dashboard,
children: [
{
path: '/products',
component: ProductsView,
},
]
},
{
path: '/platform',
component: Dashboard,
children: [
{
path: '/products',
component: ProductsView,
},
]
},
{
path: '/platform',
component: Dashboard
} ]
假设,我正在尝试为/store 和/platform 渲染Dashboard 组件,
和/store/products 和/platform/products 这两条路线的ProductView 组件。
但问题是当我点击/store/products 或/platform/products url 时,它正在呈现Dashboard 组件。
【问题讨论】:
标签: javascript vue.js routing routes vue-router