美文网首页
浏览器出现的报错信息为:[vue-router] Duplica

浏览器出现的报错信息为:[vue-router] Duplica

作者: LI_4058 | 来源:发表于2018-08-02 15:19 被阅读0次

页面路由有这样的配置就会报上面的错误:

{
    path: '/',
    name: 'index',
    component: Index
}, {
    path: '/index',
    name: 'index',
    component: Index
},

解决办法:

{
   path: '/',
   redirect: {
       name: 'index'
   }
}, {
   path: '/index',
   name: 'index',
   component: Index
}

相关文章

网友评论

      本文标题:浏览器出现的报错信息为:[vue-router] Duplica

      本文链接:https://www.haomeiwen.com/subject/fkfsvftx.html