解决:VUE项目Avoided redundant navigation to current location
提示:报错路由重复 重复点击导致控制台报错
push:
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
replace:
const originalreplace = VueRouter.prototype.replace
VueRouter.prototype.replace = function replace(location) {
return originalreplace.call(this, location).catch(err => err)
}