美文网首页
解决Uncaught (in promise) Navigati

解决Uncaught (in promise) Navigati

作者: Grit_1024 | 来源:发表于2020-12-06 14:53 被阅读0次

在VUE中路由遇到Error: Avoided redundant navigation to current location:报错显示是路由重复

image.png

在router文件夹下的index.js中加入如下代码,错误消失

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

相关文章

网友评论

      本文标题:解决Uncaught (in promise) Navigati

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