问题:使用了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)
}
1267
1万+
1万+
2018
6709
495

被折叠的 条评论
为什么被折叠?