美文网首页
vue 避免多次点击导航报错

vue 避免多次点击导航报错

作者: Hi丶粢醍 | 来源:发表于2020-09-12 20:26 被阅读0次

    // 避免多次点击导航报错

    const originalPush = VueRouter.prototype.push;
    
    VueRouter.prototype.push = function push(location) {
    
      return originalPush.call(this, location).catch(err => err);
    
    };
    

    相关文章

      网友评论

          本文标题:vue 避免多次点击导航报错

          本文链接:https://www.haomeiwen.com/subject/cuqgektx.html