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);
};
// 处理路由重复点击出错问题
posted @ 2021-09-26 11:17  荣超  阅读(162)  评论(0编辑  收藏  举报