选择某个列表之后 , 勾选几列数据后 , 再次点进去如何把之前勾选的数据在这个列表上回显勾选的项 , 解决方法如下 :
onLoad(page, params = {}) {
this.loading = true;
getList(page.currentPage,page.pageSize, Object.assign(params, this.query)).then(res => {
this.page.total = res.data.data.total;
this.data = res.data.data.records;
let selectionList = this.data.filter(item => {
for(let i = 0; i < this.idsList.length; i++){
if(this.idsList[i] === item.id) return true;
}
return false;
});
this.$nextTick(() => {
this.$refs.crud.toggleSelection(selectionList);
});
this.loading = false;
})
}