在做项目配置完路由导航的时候,发现双击导航出现报错,但不影响的运行
在router路由配置文件下添加如下代码
import VueRouter from "vue-router"
//解决路由导航双击出现报错问题
const VueRouterPush = VueRouter.prototype.push
VueRouter.prototype.push = function push (to) {
return VueRouterPush.call(this, to).catch(err => err)
}