- arrayToTree<T, C>(array, id?, options?): T[] | undefined
Type Parameters
T extends object
C extends string = "children"
Parameters
array: T[]
Optional
id: null | string | number | symbol
options: {
childrenKey?: C;
idKey?: string;
pidKey?: string;
} = ...
Optional
childrenKey?: C
Optional
idKey?: string
Optional
pidKey?: string
Returns T[] | undefined
树形结构
将数组转换为树形结构