UNPKG

hongluan-ui

Version:
30 lines (29 loc) 959 B
import type { Ref } from 'vue'; import type { GetRowKey, TreeProps, LoadFunction } from '../simple-table'; export declare type TableTreeNode = { isLoading: boolean; lazy: boolean; level: number; expanded?: boolean; }; declare function useTree({ load, treeProps, getRowKey, defaultExpandAll, expandRowKeys }: { load: LoadFunction; treeProps: TreeProps; getRowKey: GetRowKey; defaultExpandAll: Ref<boolean>; expandRowKeys: Ref<string[]>; }): { walkTreeNode: (data: unknown[], level?: number) => void; hasChildren: (row: Record<string, any>) => boolean; loadChildren: (row: Record<string, any>, level: number, finish?: () => void) => void; tableTreeMap: Ref<{ [x: string]: { isLoading: boolean; lazy: boolean; level: number; expanded?: boolean; }; }>; toggleExpandTree: (row: Record<string, any>) => Promise<void>; }; export { useTree };