Element-UI this.$confirm 弹窗 区分 右上角的x 和 取消 操作

61 阅读1分钟
this.$confirm("审核确认通过?", "提示", {
    confirmButtonText: "通过",
    cancelButtonText: "不通过",
    type: "warning",
    distinguishCancelAndClose: true,    // 重要,设置为true才会把右上角X和取消区分开来
    closeOnClickModal: false
}).then(function () {
    // TODO 确认通过执行逻辑
 
}).catch(function (e) {
    if (e == 'cancel') {
        // TODO 确认不通过执行逻辑
         
    } else if(e == 'close') {
        // TODO 右上角X的执行逻辑
 
    }
})