- 使用 distinguishCancelAndClose 属性
关闭:close
取消:cacel
ESC:close
Element.MessageBox.confirm('是否要离开?', '提示', {
confirmButtonText: '返回',
cancelButtonText: '离开',
distinguishCancelAndClose: true
}).then(() => {
store.commit('reloadMenu')
}).catch((val) => {
console.log(val, 'val')
if (val === 'close') {
} else {
}
})
标签:distinguishCancelAndClose,val,Element,ESC,关闭,close
From: https://www.cnblogs.com/DL-CODER/p/16791336.html