美文网首页
解决VUE路由跳转出现Redirected when going

解决VUE路由跳转出现Redirected when going

作者: 小李不小 | 来源:发表于2021-02-01 14:45 被阅读0次

解决方式:

1.对vue-router降低版本到3.0.7,手动修改就行了
image.png
image.png

注意:修改完之后记得删除原来的node_modules文件,再使用npm i 或yarn install生成新node_modules文件

2.第一种不行的小伙伴可以使用第二种,直接复制下面代码到router文件下index.js,也是可以解决的

const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location, onResolve, onReject) {
    if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
    return originalPush.call(this, location).catch(err => err)
}

相关文章

网友评论

      本文标题:解决VUE路由跳转出现Redirected when going

      本文链接:https://www.haomeiwen.com/subject/wvsazktx.html