用于解决$router.push跳转到一个相同的路由报错
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err)
}
这就把代码贴在
就可以了
const originalPush = Router.prototype.push
Router.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err)
}
这就把代码贴在
就可以了