Vue router报错:NavigationDuplicate

2019-10-20  本文已影响0人  御用闲人豪

在使用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);

};
上一篇 下一篇

猜你喜欢

热点阅读