vue-router 路由重复点击出错问题

 在路由的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);
};
// 处理路由重复点击出错问题
原文地址:https://www.cnblogs.com/rchao/p/15337229.html