美文网首页
element this.$confirm确认框,确认按钮阻止键

element this.$confirm确认框,确认按钮阻止键

作者: nengzhuan_zhang | 来源:发表于2021-09-09 15:00 被阅读0次
    beforeClose(action, instance, done) {
    if (action === "confirm") {
    instance.$refs["confirm"].$el.onclick = (function (e) {
    e = e || window.event;
    if (e.detail != 0) {
    done();
    }
    })();
    } else {
    done();
    }
    },
    

    参考文献:https://blog.csdn.net/zo429515/article/details/105510999
    参考文献里给click添加的function没有函数自调,结果会导致用鼠标第一次点击【确认】无效,第二次才有效。

    相关文章

      网友评论

          本文标题:element this.$confirm确认框,确认按钮阻止键

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