vue 路由重复点击,报错处理

路由重复点击,控制台会弹出提醒

// 在VueRouter上配置路由跳转,在router中的index.js中加上以下代码,注意加在use之前

const routerPush = VueRouter.prototype.push;

VueRouter.prototype.push = function (location) {

    return routerPush.call(this, location).catch(err => {})

};

 

posted @ 2022-12-07 22:14  前端追随着  阅读(174)  评论(0)    收藏  举报