解决导航问题
解决VUE路由跳转出现Redirected when going from "/xxx" to "/yyy" via a navigation guard.报错
0.0682020.08.07 10:05:20字数 95阅读 228
解决方式:
1.对vue-router降低版本到3.0.7,手动修改就行了
21388354-0ae67c66cee522bf.png
21388354-8992e94846dfe588.png
修改完之后记得删除原来的node_modules文件,再使用npm i 或yarn install生成新node_modules文件
2.第一种不行的小伙伴可以使用第二种,直接复制下面代码到router文件下index.js,也是可以解决的
constoriginalPush=VueRouter.prototype.pushVueRouter.prototype.push=functionpush(location,onResolve,onReject){if(onResolve||onReject)returnoriginalPush.call(this,location,onResolve,onReject)returnoriginalPush.call(this,location).catch(err=>err)