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