Skip to content

@vtj


@vtj / node / arrayToTree

Function: arrayToTree()

arrayToTree<T>(array, id?, parentId?, children?, root?): T[]

数组转换为树结构

Type Parameters

T extends Record<string, any>

Parameters

array

T[]

id?

keyof T

parentId?

keyof T

children?

string

root?

string | number

Returns

T[]

Defined in

packages/base/types/data.d.ts:106

Released under the MIT License.