首页 > 其他 > 详细

Vue router报错:NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}

时间:2020-06-10 23:19:35      阅读:190      评论:0      收藏:0      [点我收藏+]

技术分享图片

Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated", message: "Navigating to current location ("/left-tree/pages#subMenu1262935071369289729") is not allowed", stack: "Error?    at new NavigationDuplicated (webpack-int…node_modules/vue/dist/vue.runtime.esm.js:4567:19)"}

虽然不影响使用,但是一堆报错真的不爽

在 router.js下加这段代码就好了

技术分享图片

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

Vue router报错:NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}

原文:https://www.cnblogs.com/serahuli/p/13089603.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!