被骗了吧哈哈哈哈,这只是一个小小的操作相信大家都会我就是充个数,每天记录一点点

现在每个人都低着头,像船被搁在浅滩,现在是最好的时代,却也最坏

 

这次是拿假设做的 定义一个falg为true
<el-switch v-model=
"ruleForm.useStatus" @change="switchVhange()"></el-switch> <em v-if="ruleForm.useStatus == true">开启</em> <em v-else>关闭</em>

data中:

ruleForm: {
   useStatus: true,
 }
 falg: true
事件:@change当状态发生改变时触发
 switchVhange() {
      if (this.falg == true) {
        this.$alertMsgBox(
          "是否确定关闭状态",
          "系统提示",
          "此为门店内部信息,请谨慎填写",
          "el-icon-question",
          "#FE9100"
        )
          .then(() => {
            this.$message({
              type: "success",
              message: "已关闭"
            });
            this.falg = false;
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
            this.ruleForm.useStatus = true;
          });
      } else if (this.falg == false) {
        this.$alertMsgBox(
          "是否确定开启状态",
          "系统提示",
          "此为门店内部信息,请谨慎填写",
          "el-icon-question",
          "#FE9100"
        )
          .then(() => {
            this.$message({
              type: "success",
              message: "已开启"
            });
            this.falg = true;
          })
          .catch(() => {
            this.$message({
              type: "info",
              message: "已取消"
            });
            this.ruleForm.useStatus = false;
          });
      }
    }

 



 

相关文章:

  • 2021-05-20
  • 2021-09-23
  • 2021-08-27
  • 2022-12-23
  • 2022-12-23
  • 2021-11-16
  • 2022-12-23
  • 2021-04-26
猜你喜欢
  • 2022-12-23
  • 2021-12-09
  • 2022-12-23
  • 2021-06-12
  • 2021-08-11
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案