路由跳转报错

74 阅读1分钟

今天新建项目时,有个报错。跳转正常,就是显示报错

报错.png

解决方法: 在router/index.js 加上如下代码

const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
    return routerPush.call(this, location).catch(error=> error)
}

解决.png

问题得到解决