解决vue-router报NavigationDuplicated: Avoided redundant navigation to current location 的问题
报错是因为重复触发了同一个路由。
在router里加入
const originalPush = Router.prototype.push
Router.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}