修复insertNodesByKey方法批量添加异常问题 (#2695)
当批量添加节点parentKey为空时,未赋值treeDataRef导致添加异常
This commit is contained in:
parent
122db78e84
commit
cfbd5e9851
|
|
@ -141,6 +141,8 @@ export function useTree(treeDataRef: Ref<TreeDataItem[]>, getFieldNames: Compute
|
||||||
for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
treeData[push](list[i]);
|
treeData[push](list[i]);
|
||||||
}
|
}
|
||||||
|
treeDataRef.value = treeData;
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
const { key: keyField, children: childrenField } = unref(getFieldNames);
|
||||||
if (!childrenField || !keyField) return;
|
if (!childrenField || !keyField) return;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue