⚠警告
[vue-router] Named Route 'index' has a default child route. When navigating to this named route (:to="{name: 'index'"), the default child route will not be rendered. Remove the name from this route and use the name of the default child route for named links instead
在Vue的项目中使用了Vue-Router,当某个路由有子级路由时,如下写法
export default new Router({
routes: [
{
path: '/',
name: 'home',
component: ()=>import('@/components/pages/home'),
children:[
{
path:'list',
name: 'list',
component: ()=>import('@/components/pages/menu/list'),
}
]
}
]
})