按照全路径查找指定元素
源数组
过滤函数
存放查找的结果数组
查找到的目标节点
const tree = [{ id: '1', children: [{ id: '2', children: [] }] }];const result = deepFindPath(tree, node => node.id === '2');// 返回 [ { id: '1', ... }, { id: '2', ... } ] Copy
const tree = [{ id: '1', children: [{ id: '2', children: [] }] }];const result = deepFindPath(tree, node => node.id === '2');// 返回 [ { id: '1', ... }, { id: '2', ... } ]
Generated using TypeDoc
按照全路径查找指定元素