eachTree
Functions
eachTree()
eachTree<
T
>(array
,iterator
,options
):any
根据迭代器遍历树列表
Type parameters
Parameter |
---|
T extends Object |
Parameters
Parameter | Type | Description |
---|---|---|
array | T [] | 树列表 |
iterator | TreeIterator <T , void > | 迭代器 |
options | EachTreeOptions | 配置项 |
Returns
any
Example
ts
eachTree(
[
{
id: 1,
text: '1',
children: [
{
id: 3,
text: '3',
}
]
},
{
id: 2,
text: '2',
}
],
(node) => console.log(node.text),
)
Interfaces
EachTreeOptions
Properties
Property | Type | Description |
---|---|---|
childrenKey? | string | 子节点键 Default 'children' |