element-ui table树形表格懒加载

el-table
:data="list"
style="width: 100%"
row-key="id"
:key="Math.random()"
border
lazy
ref="multipleTable"
@selection-change="checkAll"
:load="loadChild"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}">
</el-table>

methods: {
loadList() {
api.findList(this.form, this.page.pageNum, this.page.pageSize).then((result) => {
this.list = result.data.list;
this.page.totalCount = result.data.total;
})
},
loadChild(tree, treeNode, resolve) {
api.findChildrenById(tree.id).then((result) => {
resolve(result.data);
});
}
}

posted @ 2021-07-24 23:54  雪莉06  阅读(1584)  评论(0编辑  收藏  举报