com-tools
Version:
com-tools 提供了一些通用的工具函数;
67 lines (31 loc) • 1 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [com-tools](./com-tools.md) > [groupTreeBy](./com-tools.grouptreeby.md)
## groupTreeBy() function
根据 getGroupPath 提示的多层级分组信息,将 members 整理成 树状的分组层级结构
**Signature:**
```typescript
export declare function groupTreeBy<Member, Group extends PropertyKey = string>(members: Member[], getGroupPath: GetGroupPath<Member, Group>): GroupTree<Member, Group>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
members
</td><td>
Member\[\]
</td><td>
</td></tr>
<tr><td>
getGroupPath
</td><td>
[GetGroupPath](./com-tools.getgrouppath.md)<!-- --><Member, Group>
</td><td>
</td></tr>
</tbody></table>
**Returns:**
[GroupTree](./com-tools.grouptree.md)<!-- --><Member, Group>