Element-ui 重复点击同一个路由 会报错:NavigationDuplicated {_name: “NavigationDuplicated”, name: “NavigationDuplicated”}
解决办法:
在router/index.js里重写Router.prototype.push
import Router from 'vue-router'
//需要添加的代码
const originalPush = Router.prototype.push;
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
};