解决vue路由重复的问题 vue-router.esm.js?8c4f:2065 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: “/index”.
解决办法
1 在router/index.js下添加这些代码
import Router from ‘vue-router’
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}