因而查了一下發現能夠這樣解決javascript
router文件夾下面的index.js中加上下面幾句代碼java
const originalPush = Router.prototype.push Router.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) }