使用element 自身函数
this.$set(this.$refs.tableRef.store.states.lazyTreeNodeMap, id, data)
注意:
id 需要和 row-key保持一致
如:
row-key="dept_id"
<el-table
class="custom-table"
ref="tableRef"
:data="agencyList"
row-key="dept_id"
lazy
:load="onLoadChildren"
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
const store = this.$refs.tableRef.store
this.$set(store.states.lazyTreeNodeMap, res.dept_id, ress)
网友评论