1.重复路由点击报错
2.首先检查,路由跳转时候用的
push
方法还是replace方法
this.$router.push()的话把这段代码添加到router 文件夹下的 index.js文件中
// 解决重复点击报错bug
const VueRouterPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(to) {
return VueRouterPush.call(this, to).catch(err => err);
}
this.$router.replace()的话把这段代码添加到router 文件夹下的 index.js文件中
// 解决重复点击报错bug
const VueRouterPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(to) {
return VueRouterPush.call(this, to).catch(err => err);
}
3.好了,这样问题就解决了!