双击跳转路由时,会报错,可以给VueRouter设置相关的重置方法解决问题,找到router/index.js添加下面两行代码
//解决 用this.routes.push 跳转时报错问题
const originalPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
return originalPush.call(this, location).catch(err => err)
}
const router = new VueRouter({
//吧地址栏中的#去掉
mode:'history',
routes
})