解决报错Uncaught (in promise) NavigationDuplicated {_name: "NavigationDuplicated", name: "NavigationDuplicated"}

  先上一下报错的截图:

  

  介绍一下解决方式:

  在router目录下的index.js文件中加入如下代码:

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

  

  这样就解决了。。。。

猜你喜欢

转载自www.cnblogs.com/belongs-to-qinghua/p/12549602.html
今日推荐