<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [com-tools](./com-tools.md) &gt; [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)<!-- -->&lt;Member, Group&gt;


</td><td>


</td></tr>
</tbody></table>
**Returns:**

[GroupTree](./com-tools.grouptree.md)<!-- -->&lt;Member, Group&gt;


