vue-router路由跳转报错

vue-router使用报错手册:

①:多次点击路由进行路由跳转时,页面控制器会报错
vue-router路由跳转报错
解决方案:在main.js文件下添加如下代码即可

import Router from ‘vue-router’
const routerPush = Router.prototype.push
Router.prototype.push = function push(location) {
return routerPush.call(this, location).catch(error=> error)
}

注:该解决方案参考博客园的F.dragon大佬!