问题
树形子组件数据渲染不出来,导致expand无法执行

image.png
成功效果应如下

image.png
解决
- 设置
hasChildren为true
tableData: [{
// deptName: '全院',
hasChildren: true
}]
- 在
load里面执行children的更新
load(tree, treeNode, resolve) {
console.log('执行load', tree, treeNode, resolve)
setTimeout(() => {
resolve(
this.$set(this.tableData[0], 'children', tree.children)
)
}, 1000)
}