解决Vue-Router升级导致的Uncaught(in promise) navigation guard问题

在new VueRouter后边加上以下代码

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)
}
原文地址:https://www.cnblogs.com/lahm8963/p/14754124.html