以element-ui中messageBox弹出框为例

function Notarize(_this){
    return new Promise((resolve,rejects) => {
        _this.$confirm('此操作将永久删除, 是否继续?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            // 逻辑处理
            resolve(true) //确认返回true
          }).catch(() => {
            _this.$message({
              type: 'info',
              message: '已取消删除'
            });
            resolve(false) //取消返回false
          });
    })
}

 接收返回值

Notarize(this).then(flag=>{
  console.log(flag)
})

  

相关文章:

  • 2022-02-09
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-12
  • 2022-12-23
猜你喜欢
  • 2021-10-23
  • 2021-11-06
  • 2022-12-23
  • 2021-12-10
  • 2022-02-24
  • 2021-05-02
  • 2021-09-22
相关资源
相似解决方案