• 循环遍历树形数据

    Type Parameters

    • T = any

    Parameters

    • tree: T[]

      树形数据

    • func: ((n) => any)

      循环遍历节点的函数

        • (n): any
        • Parameters

          Returns any

    • config: Partial<TreeHelperConfig> = {}

      树形的配置项

    Returns void

    Example

    const tree = [{value: 1, id: 1, children: [{value: 2, pid: 1, id: 2, children: [{value: 3, pid: 2, id: 3}]}]}]
    const nodes = forEach(tree, (node) => {
    console.log(node)
    })

Generated using TypeDoc