Vue router报错:NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}的解决方法

在使用Element UI 时点击同一个路由,控制台报错,但不影响使用
20190910094554144.png
解决方法如下:
在引用vue-router的文件中添加一段代码

const originalPush = Router.prototype.push;

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

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

};
发布了14 篇原创文章 · 获赞 0 · 访问量 791

猜你喜欢

转载自blog.csdn.net/xjh01/article/details/104101006