vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解决方法

今天在写项目时发现了在点击 路由跳转 会造成报错的问题, 报错内容为: 在这里插入图片描述

在引入 import Router from 'vue-router'文件里面添加如下代码:

const originalPush = Router.prototype.push

Router.prototype.push = function push(location) {

  return originalPush.call(this, location).catch(err => err)

}

解决

但主要原因是使用的element-ui组件跳转路径配置index问题

        {{childItem.menusName}}

修改 :index路径,完美解决

你可能感兴趣的:(vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated"... 的解决方法)