element---在el-table中el-switch用法

项目中操作此数据:
element---在el-table中el-switch用法_第1张图片


  

在这里插入图片描述

   // 是否展示
    handleStatusChange (row) {
        let text = row.custom === '1' ? "展示" : "不展示";
        let params = { }
        this.$confirm('确认要操作当前此条数据吗?', "警告",
          {
            confirmButtonText: "确定",
            cancelButtonText: "取消",
            type: "warning",
          })
          .then(async()=> {
          //调用后台接口,根据后台对应字段row.custom
            return getingfile(params);
          })
          .then(() => {
            this.msgSuccess(text + "成功");
          })
          .catch(()=> {
          //取消
            row.custom = row.custom === '1'? '0': '1';
          });
    },

你可能感兴趣的:(element,elementui,前端)