在路由的js中添加
import VueRouter from "vue-router";
// 处理路由重复点击出错问题
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err);
};
const originalReplace = VueRouter.prototype.replace;
VueRouter.prototype.replace= function replace(location) {
return originalReplace.call(this, location).catch(err => err);
};
// 处理路由重复点击出错问题