解决报错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)
}

  

  这样就解决了。。。。

 

posted @ 2020-03-23 00:13  刘彤彤  阅读(503)  评论(0编辑  收藏  举报