element-ui表格中的复选框默认选中状态、禁用状态以及默认选中不可取消状态

element-ui表格中的复选框默认选中状态、禁用状态以及默认选中不可取消状态_表格中el-checkbox默认显示选择-CSDN博客
<el-table
    ref="multipleTable"
    :data="tableData3"
    tooltip-effect="dark"
    style="width: 100%"
    @selection-change="handleSelectionChange">
    <el-table-column
      type="selection"
      width="55">
    </el-table-column>
    <el-table-column
      label="日期"
      width="120">
      <template slot-scope="scope">{{ scope.row.date }}</template>
    </el-table-column>
    <el-table-column
      prop="name"
      label="姓名"
      width="120">
    </el-table-column>
    <el-table-column
      prop="address"
      label="地址"
      show-overflow-tooltip>
    </el-table-column>
  </el-table>

根据后台返回数据的特定字段确定多选框是否选中

 SelectionChange() {
      this.$nextTick(() => {
        let table = this.tableData3; // 从后台获取到的数据
        table.forEach(row => {
          if (row.SIGN_STAT == "已签署")
            this.$refs.multipleTable.toggleRowSelection(row, true);
        });
      });
    },

 

posted @ 2024-07-12 11:22  .Tik  阅读(2571)  评论(0)    收藏  举报