Element 关闭图标区分关闭、取消、ESC

  • 使用 distinguishCancelAndClose 属性

关闭:close(关闭弹框)

取消:cacel(cancelButtonText)

ESC:close(关闭弹框)

      Element.MessageBox.confirm('是否要离开?', '提示', {
        confirmButtonText: '返回',
        cancelButtonText: '离开',
        distinguishCancelAndClose: true
      }).then(() => {
        store.commit('reloadMenu')
      }).catch((val) => {
        console.log(val, 'val') // val === close 或者cacel
        if (val === 'close') {

        } else {

        }
      })
posted @ 2022-10-14 13:30  DL·Coder  阅读(645)  评论(0编辑  收藏  举报