// 获取原型对象push函数
const originalPush = VueRouter.prototype.push
// 修改原型对象中的push函数
VueRouter.prototype.push = function push(location){
return originalPush.call(this , location).catch(err=>err)
}
// 获取原型对象replace函数
const originalReplace = VueRouter.prototype.replace
// 修改原型对象中的replace函数
VueRouter.prototype.replace = function replace(location){
return originalReplace.call(this , location).catch(err=>err)
}
05-26
101
07-21
634
07-08
3355
05-28
1万+
12-13
1761
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交