在点击一个路由跳转时,点击几次后浏览器就出现报错
Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location
解决方法
Vue.use(VueRouter)
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
return VueRouterPush.call(this, to).catch(err => err)
}
//加上这段代码就解决了