首页 > 其他分享 >vue 路由重复点击,报错处理

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

时间:2022-12-07 22:22:06浏览次数:50  
标签:vue 点击 报错 location VueRouter prototype 路由

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

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

const routerPush = VueRouter.prototype.push;

VueRouter.prototype.push = function (location) {

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

};

 

标签:vue,点击,报错,location,VueRouter,prototype,路由
From: https://www.cnblogs.com/caujiajia/p/16964736.html

相关文章