Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation to current location: "/goodsList".
在用vue-router 做单页应用的时候重复点击一个跳转的路由会出现报错

这个报错是重复路由引起的
只需在注册路由组建后使用下方重写路由就可以
import Router from 'vue-router';
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}


网友评论