当前位置:   article > 正文

Named Route index has a default child route. When navigating to this named route to name index_named route 'index' has a default child route. whe

named route 'index' has a default child route. when navigating to this named

⚠警告 

[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,当某个路由有子级路由时,如下写法 

  1. export default new Router({
  2. routes: [
  3. {
  4. path: '/',
  5. name: 'home',
  6. component: ()=>import('@/components/pages/home'),
  7. children:[
  8. {
  9. path:'list',
  10. name: 'list',
  11. component: ()=>import('@/components/pages/menu/list'),
  12. }
  13. ]
  14. }
  15. ]
  16. })

如果写法是如上的写法,就会报出如下警告:

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/402357
推荐阅读
相关标签
  

闽ICP备14008679号