elementUi - - - - table check function & disable check

elementUi - - - - table check function & disable check

1. Table check function

code show as below:

<el-table :data="tableData" ref="multipleTable" @selection-change="handleSelectionChange"  >
          <el-table-column type="selection" width="55"></el-table-column>
</el-table>

...
    // 勾选
    handleSelectionChange(val) {
      // 这里是勾选回调
      this.multipleSelection = val;
    },

The above code can realize the check function

2. The table prohibits ticking

code show as below:

<el-table :data="tableData" ref="multipleTable" @selection-change="handleSelectionChange" :selectable="checkboxT" disabled="true" >
          <el-table-column type="selection" width="55"></el-table-column>
</el-table>

...
    // 勾选
    handleSelectionChange(val) {
      // 这里是勾选回调
      this.multipleSelection = val;
   },
   // 禁止勾选
   checkboxT(row, index) {
      return row.can_edit;
    },

Guess you like

Origin blog.csdn.net/Dark_programmer/article/details/131600921