vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated&qu

Posted guozhiqiang

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated&qu相关的知识,希望对你有一定的参考价值。

今天在写vue-music的时候,发现每次跳转路由都会出现这个错误,于是上网查了一下解决的方法

在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)
}

以上是关于vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated&qu的主要内容,如果未能解决你的问题,请参考以下文章

Vue-Router:Uncaught (in promise) 报错处理

vue router 报错: Uncaught (in promise) NavigationDuplicated {_name:""NavigationDuplicated&qu

vue-router点击菜单栏同一个模块报错 ———— Uncaught(in promise) NavigationDuplicated error .......

vue报错Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “

vue-router.esm.js?fe87:2007 Uncaught (in promise) NavigationDuplicated {_name: "Navigation

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