1: toggleRowSeeletion() : 设置默认多选模式
<el-table
ref="multipleTableClinicRoom"
:data="tableData"
stripe
border
v-loading="tableLoading"
highlight-current-row
@row-click="handleCurrentChange"
:cell-class-name="getCellIndex"
class="clinic-area-table-area tb-edit"
@selection-change="handleClinicRoomChange"
empty-text="暂无数据">
<el-table-column type="selection" width="55">
......
</el-table-column>
</el-table>
this.tableData.forEach((item, index) => {
if (item.selectStatus === 0) {
// 等表格数据加载完成后
this.$nextTick(() => {
// 注意:toggleRowSelection(item, true) 中 item 必须是行数据
this.$refs.multipleTableClinicRoom.toggleRowSelection(this.tableData[index], true)
})
}
})
elementUI el-table 组件多选 设置默认勾选
最新推荐文章于 2024-05-17 16:40:55 发布