解决vue报错NavigationDuplicated

1. 报错信息

这个报错不影响功能,看着不舒服,就解决掉

2. 解决办法

在main.js添加下面几句话


import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

成功解决

posted @ 2019-10-20 22:40  夏沫浅语  阅读(1146)  评论(0编辑  收藏  举报