Bootstrap

el-table多选列表已选中数据回显

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() { // 在获取List后调用方法
            this.$nextTick(() => {
                this.$refs.multipleTable.clearSelection();
                this.List.forEach(row => {
                   if (row.hasAgree != 0) { //后端返回判断条件
                     this.$refs.multipleTable.toggleRowSelection(row);
                    }
                })
            })
        },
;