解决多次跳转同一路由时报错

const originalPush = Router.prototype.push // 获取原型对象上的push函数
Router.prototype.push = function push (location) { // 修改原型对象中的push方法
    return originalPush.call(this, location).catch(err => err)
}

Vue.use(Router);
posted @ 2021-02-23 10:44  张尊娟  阅读(103)  评论(0编辑  收藏  举报