vue router Uncaught (in promise)
原因: 没有使用catch捕获方法
解决方法: 重写 Router 原型链上的 push、replace 方法
import Router from 'vue-router'
const originalPush = Router.prototype.push
Router.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)
}

 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号