vue 导航守卫 router 高版本报错
作者:互联网
重写 push 事件
import VueRouter from 'vue-router'
const originalPush = VueRouter.prototype.push VueRouter.prototype.push = function push(location, onResolve, onReject) { if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject) return originalPush.call(this, location).catch(err => err) }
标签:vue,onResolve,报错,location,VueRouter,push,router,onReject,originalPush 来源: https://www.cnblogs.com/jxfy/p/14837372.html