feat(tree): add insertNodesByKey method

This commit is contained in:
无木 2021-07-02 02:26:13 +08:00
parent d52b0de83e
commit 5a20df45ad

View File

@ -97,8 +97,7 @@
}, },
onRightClick: handleRightClick, onRightClick: handleRightClick,
}; };
propsData = omit(propsData, 'treeData', 'class'); return omit(propsData, 'treeData', 'class');
return propsData;
}); });
const getTreeData = computed((): TreeItem[] => const getTreeData = computed((): TreeItem[] =>
@ -109,8 +108,14 @@
return searchState.startSearch && searchState.searchData?.length === 0; return searchState.startSearch && searchState.searchData?.length === 0;
}); });
const { deleteNodeByKey, insertNodeByKey, filterByLevel, updateNodeByKey, getAllKeys } = const {
useTree(treeDataRef, getReplaceFields); deleteNodeByKey,
insertNodeByKey,
insertNodesByKey,
filterByLevel,
updateNodeByKey,
getAllKeys,
} = useTree(treeDataRef, getReplaceFields);
function getIcon(params: Recordable, icon?: string) { function getIcon(params: Recordable, icon?: string) {
if (!icon) { if (!icon) {
@ -267,6 +272,7 @@
setCheckedKeys, setCheckedKeys,
getCheckedKeys, getCheckedKeys,
insertNodeByKey, insertNodeByKey,
insertNodesByKey,
deleteNodeByKey, deleteNodeByKey,
updateNodeByKey, updateNodeByKey,
checkAll, checkAll,