Browse Source

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

main
xingyu 2 years ago
parent
commit
1092addb5e
  1. 2
      src/components/Tree/src/BasicTree.vue
  2. 2
      src/components/Tree/src/types/tree.ts

2
src/components/Tree/src/BasicTree.vue

@ -297,7 +297,7 @@ export default defineComponent({
}) })
const instance: TreeActionType = { const instance: TreeActionType = {
treeData: treeDataRef, getTreeData: () => treeDataRef,
setExpandedKeys, setExpandedKeys,
getExpandedKeys, getExpandedKeys,
setSelectedKeys, setSelectedKeys,

2
src/components/Tree/src/types/tree.ts

@ -165,7 +165,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