-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: improve readme, update api docs
- Loading branch information
Showing
6 changed files
with
194 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [sculp-js](./sculp-js.md) > [forEachMap](./sculp-js.foreachmap.md) | ||
|
||
## forEachMap() function | ||
|
||
深度优先遍历的Map函数(支持continue和break操作), 可用于insert tree item 和 remove tree item | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
declare function forEachMap<V>( | ||
tree: ArrayLike<V>, | ||
iterator: ( | ||
val: V, | ||
i: number, | ||
currentArr: ArrayLike<V>, | ||
tree: ArrayLike<V>, | ||
parent: V | null, | ||
level: number | ||
) => boolean | any, | ||
children?: string, | ||
isReverse?: boolean | ||
): any[]; | ||
``` | ||
|
||
## Parameters | ||
|
||
| Parameter | Type | Description | | ||
| --------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------ | | ||
| tree | ArrayLike<V> | 树形数据 | | ||
| iterator | (val: V, i: number, currentArr: ArrayLike<V>, tree: ArrayLike<V>, parent: V \| null, level: number) => boolean \| any | 迭代函数, 返回值为true时continue, 返回值为false时break | | ||
| children | string | _(Optional)_ 定制子元素的key | | ||
| isReverse | boolean | _(Optional)_ 是否反向遍历 | | ||
|
||
**Returns:** | ||
|
||
any\[\] | ||
|
||
{<!-- -->any\[\]<!-- -->} 新的一棵树 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters