• 查找所有父节点

    Parameters

    • tree: any

      树形数据

    • func: Fn<any>

      查找节点的函数

    • config: Partial<TreeHelperConfig> = {}

      树形的配置项

    Returns any[]

    Example

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

Generated using TypeDoc