Element-ui 重复点击同一个路由 会报错:
NavigationDuplicated {_name: “NavigationDuplicated”, name: “NavigationDuplicated”}
解决办法:
在router/index.js
import Vue from 'vue'
import VueRouter from 'vue-router'
import store from '@/store'
Vue.use(VueRouter)
//解决路由跳转原路由或者刷新出错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}