Skip to content

KBE3D / KBCore / utils / findNode

函数: findNode()

findNode<T>(tree: any, func: TreeCallbackFn, config?: Partial<TreeMappingConfig>): T | undefined

找到一个符合条件的节点

类型参数

T

T = any

参数

tree

any

目标树结构

func

TreeCallbackFn

回调函数

config?

Partial<TreeMappingConfig> = {}

配置项

返回

T | undefined

符合条件的节点

备注

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

KBE3D @3.0.0 Copyright © 2024-present KBE3D