vue路由报错Avoided redundant navigation to current location: "/console"

82 阅读1分钟

前端路由报错

image.png

只需要简单的在路由里面加上

image.png

const originalPush = VueRouter.prototype.push
// 修改 原型对象中的push方法
VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch(err=>err)
}

欢迎各位小伙伴来我的QQ交流群一起学习 :842167453