描述问题
vue-router 在 3.0 以上版本重复点击菜单引起的路由重复报错
解决
在 main.js
导入包的下面,增加下面代码:
const includPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return includPush.call(this, location).catch(err => err)
}
vue-router 在 3.0 以上版本重复点击菜单引起的路由重复报错
在 main.js
导入包的下面,增加下面代码:
const includPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return includPush.call(this, location).catch(err => err)
}