<el-table :data="bdtableData" border v-loading="loading" @selection-change="handleSelectionChange" ref="multipleTable">
<el-table-column type="selection" width="55" align="center" />
<el-table-column prop="mingch" align="center" label="名称" />
</el-table>
getbangdingList(params).then(res => {
this.bdtableData = res.rows;
this.bdtableData.forEach(item => {
if (item.index) {
if (item.index == 1) { //根据数据判断需要回显的内容
this.$nextTick(()=>{
this.$refs.multipleTable.toggleRowSelection(item)
})
}
}
});
})
handleSelectionChange(val) {
this.multipleSelection = val;
},
附数据:
"rows": [
{
"mingch": "设计研发",
"index": 1
},
{
"mingch": "读数显微镜/投影仪",
"index": 1
},
{
"mingch": "顶顶顶顶顶",
"index": 1
},
{
"mingch": "生宿舍",
"index": 1
},
{
"mingch": "生宿舍"
},
{
"mingch": "水水水水"
},
]