解決方式:
1.對vue-router降低版本到3.0.7,手動修改就行了

21388354-0ae67c66cee522bf.png

21388354-8992e94846dfe588.png
修改完之后記得刪除原來的node_modules文件,再使用npm i 或yarn install生成新node_modules文件
2.第一種不行的小伙伴可以使用第二種是重寫router.push()方法,直接復(fù)制下面代碼到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)
}