问题:使用了this.$router.push方法,出现这个错误
解决方法:在配置路由的js文件中加入这两行代码:
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}
问题:使用了this.$router.push方法,出现这个错误
解决方法:在配置路由的js文件中加入这两行代码:
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}