- convertTreeData<T, P>(treeData, callback, childrenFieldName?, level?): ConvertedTreeData<T, P>[]
Type Parameters
- T extends Record<string, any>
- P extends Record<string, any>
Parameters
- treeData: readonly T[]
- callback: ((node: T, level: number) => P)
- (node, level): P
Returns P
- childrenFieldName: keyof T = 'children'
- level: number = 0
Returns ConvertedTreeData<T, P>[]
树形数据结构
将树形数据转换为需要的格式