el-table多选列表已选中数据回显
<el-table :data="List" :header-cell-style="{ 'text-align': 'center' }":cell-style="{ 'text-align': 'center' }" style="width: 100%" v-loading="loading" ref="multipleTable":row-key="(row) => { return row.id }" @selection-change="handleSelectionChange">
<el-table-column type="selection" min-width="45" :reserve-selection="true" />
<el-table-column label="唯一id" prop="id" v-if="false" />
<el-table-column label="名称" prop="Name" />
ids: [],
List: [],
toggleSelectionItem() {
this.$nextTick(() => {
this.$refs.multipleTable.clearSelection();
this.List.forEach(row => {
if (row.hasAgree != 0) {
this.$refs.multipleTable.toggleRowSelection(row);
}
})
})
},