Skip to content

KBE3D / KBCore / utils / treeMap

函数: treeMap()

treeMap<T, U>(treeData: T[], options: { conversion: TreeCallbackFn<T, U>; children?: string; }): U[]

对树结构中每个数据进行指定函数的变换,并返回新的树

类型参数

T

T extends Record<string, any>

U

U = T

参数

treeData

T[]

目标树结构数据

options

配置项

conversion

TreeCallbackFn<T, U>

转换函数

children?

string

children属性的映射

返回

U[]

新的树结构

KBE3D @3.0.0 Copyright © 2024-present KBE3D