const oldPush = VueRouter.prototype.push;
const oldReplace = VueRouter.prototype.replace;
VueRouter.prototype.push = function (location: RawLocation) {
return oldPush.call(this, location).catch((err: any) => err);
};
VueRouter.prototype.replace = function (location: RawLocation) {
return oldReplace.call(this, location).catch((err: any) => err);
};
路由跳转静默处理
于 2022-07-23 17:31:12 首次发布