关于VUE项目中报Error: Avoided redundant navigation to current location: 的错

在router的配置文件(router->index.js)中加入以下代码

const originalPush = VueRouter.prototype.push
  VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err => err)
}

猜你喜欢

转载自www.cnblogs.com/lavinia/p/13206476.html