AdminTree Component
Overview
A tree control. Loads entity data from the database and automatically builds it into a tree structure based on parent-child relationships. Commonly used in scenarios such as organization selection and menu selection.
Parameters
| Parameter | Description |
|---|---|
| TItem | Entity type |
| @bind-Value | Bind the selected value list |
| GetText | Tree node display text |
| Where | Data filter expression |
| SortString | Sort field (e.g., "Sort") |
Usage Example
<AdminTree TItem="SysOrg"
@bind-Value="@selectedOrgIds"
GetText="@(o => o.Name)"
Where="x => x.IsEnabled"
SortString="Sort" />
Notes
- The entity must include a
ParentIdproperty and implement theIHasParentId<TKey>interface to support tree structure SortStringspecifies the sort field name; child nodes are sorted by this field among siblings