Commit cfbd5e98515e55eaa0c99f54c2783b23f0ce9180

Authored by zhenbintuo
Committed by GitHub
1 parent 122db78e

修复insertNodesByKey方法批量添加异常问题 (#2695)

当批量添加节点parentKey为空时,未赋值treeDataRef导致添加异常
src/components/Tree/src/hooks/useTree.ts
... ... @@ -141,6 +141,8 @@ export function useTree(treeDataRef: Ref<TreeDataItem[]>, getFieldNames: Compute
141 141 for (let i = 0; i < list.length; i++) {
142 142 treeData[push](list[i]);
143 143 }
  144 + treeDataRef.value = treeData;
  145 + return;
144 146 } else {
145 147 const { key: keyField, children: childrenField } = unref(getFieldNames);
146 148 if (!childrenField || !keyField) return;
... ...