解决vue编程式导航多次点击报错问题

解决vue编程式导航多次点击报错问题,第1张

把以下代码插入在router文件下就可以解决

// 下面是解决编程式导航多次点击路由时报错的方法

let originPush = VueRouter.prototype.push;

VueRouter.prototype.push = function(location,resolve,reject){

if (resolve && reject) {

originPush.call(this,location,resolve,reject);

}else{

originPush.call(this,location,()=>{},()=>{});

}

}

 

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/web/940927.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-17
下一篇2022-05-17

发表评论

登录后才能评论

评论列表(0条)

    保存