MessageBox confirm弹框确认和取消按钮的使用-回调

需求: 点击按钮,弹框出现左右按钮,点击左右按钮分别再次弹框。

注意:需要使用then和catch进行捕获

projectAudPub(id, name) {
      this.$confirm(`审核 ${name}`, "提示", {
        type: "warning",
        confirmButtonText: "审核通过",
        cancelButtonText: "审核不通过",
      }).then((action) => {
        if (action == "confirm") {
          this.$confirm(`项目将会自动发布,确认审核通过 ${name}`, "提示", {
            type: "success",
            confirmButtonText: "确定",
            cancelButtonText: "取消",
          });
        }
      }).catch(err =>{
        if(err=="cancel"){
          this.$confirm(`项目须重新编辑后提审,确认审核不通 ${name}`, "提示", {
            type: "error",
            confirmButtonText: "确定",
            cancelButtonText: "取消",
          });
        }
      });
    },

点击按钮,展示弹框,
点击审核通过,展示弹框02,
点击审核不通过,展示弹框03
在这里插入图片描述
点击审核通过,跳出的弹框02
在这里插入图片描述
点击审核不通过,跳出的弹框03
在这里插入图片描述

  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值