// 解决重复点击导航路由报错
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (location) {
return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
直接复制到router.js里,粘贴的时候,注意下执行顺序,这段是放在new VueRouter的前面