浏览器出现的报错信息为:[vue-router] Duplicate named routes definition: { name: "登录", path: "/login" }

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

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

解决办法:

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

你可能感兴趣的:(浏览器出现的报错信息为:[vue-router] Duplicate named routes definition: { name: "登录", path: "/login" })