效果如图:
【确认通过】按钮执行逻辑A,【确认不通过】按钮执行逻辑B。代码如下:
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的执行逻辑
}
})