Browse Source

perf(BasicTree): 获取treeData改写成函数

invalid w 1 year ago
parent
commit
748b99b18f
2 changed files with 2 additions and 2 deletions
  1. 1 1
      src/components/Tree/src/BasicTree.vue
  2. 1 1
      src/components/Tree/src/types/tree.ts

+ 1 - 1
src/components/Tree/src/BasicTree.vue

@@ -320,7 +320,7 @@
       });
       });
 
 
       const instance: TreeActionType = {
       const instance: TreeActionType = {
-        treeData: treeDataRef,
+        getTreeData: () => treeDataRef,
         setExpandedKeys,
         setExpandedKeys,
         getExpandedKeys,
         getExpandedKeys,
         setSelectedKeys,
         setSelectedKeys,

+ 1 - 1
src/components/Tree/src/types/tree.ts

@@ -171,7 +171,7 @@ export interface InsertNodeParams {
 }
 }
 
 
 export interface TreeActionType {
 export interface TreeActionType {
-  treeData: Ref<TreeDataItem[]>;
+  getTreeData: () => Ref<TreeDataItem[]>;
   checkAll: (checkAll: boolean) => void;
   checkAll: (checkAll: boolean) => void;
   expandAll: (expandAll: boolean) => void;
   expandAll: (expandAll: boolean) => void;
   setExpandedKeys: (keys: KeyType[]) => void;
   setExpandedKeys: (keys: KeyType[]) => void;