Error: Redirected when going from “/***“ to “/***“ via a navigation guard

解决方法

将下方代码复制进router/index.js中即可

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

你可能感兴趣的:(js,vue,jsvascript,vue,js)