Skip to content

KBE3D / KBCore / utils / forEachTree

函数: forEachTree()

forEachTree<T>(tree: T[], func: (n: T) => any, config?: Partial<TreeMappingConfig>): void

遍历树结构数据

类型参数

T

T = any

参数

tree

T[]

目标树结构

func

(n: T) => any

回调函数

config?

Partial<TreeMappingConfig> = {}

配置项

返回

void

备注

ts
 DEFAULT_CONFIG: TreeMappingConfig = {
   children: 'children',
 }

KBE3D @3.0.0 Copyright © 2024-present KBE3D