问题愿意:依赖包中vue-router出现问题(猜想为版本问题);vue
解决方法:在项目目录下运行vue-router
npm i vue-router@3.0 -S
这条指令就能够解决了。(更换版本)npm
或者在main.js中添加如下代码:测试
import Router from 'vue-router' const originalPush = Router.prototype.push Router.prototype.push = function push(location) { return originalPush.call(this, location).catch(err => err) }
参考来源:http://www.javashuo.com/article/p-rxywddkn-mz.htmlthis
以上。spa
第二种方法未测试,使用第一种方法后问题就已经获得解决了。.net