Tree
Nested details tree, role=tree
A hierarchy people expand and browse — files, a category tree, a table of contents. For a small chart of who reports to whom, OrgChart; to pick one value from a hierarchy, TreeSelect.
Basic
src
components
docs
- README.md
- One Tab stop: ↑ / ↓ move through the visible rows, → opens a branch or enters it, ← closes it or goes to the parent, Home / End jump. Enter picks the row (a branch too — Space opens and closes it). Branches say whether they're open.
- Branches are native
<details>, so they work before scripts run.hrefmakes a leaf a link;v-model:selectedholds the picked id.
Usage
ts
import { BlessTree, BlessTreeItem } from "blessing-ui";API
BlessTree
Props
| Name | Type | Default | Description |
|---|---|---|---|
nodes* | BlessTreeNode[] | — | |
label | string | "Tree" | |
selected | string | — |
Events
| Name | Payload | Description |
|---|---|---|
select | [node: BlessTreeNode, path: string] | |
update:selected | [value: string | undefined] |
BlessTreeItem
Props
| Name | Type | Default | Description |
|---|---|---|---|
node* | BlessTreeNode | — | |
path* | string | — | |
selected | string | — | |
level* | number | — |
Events
| Name | Payload | Description |
|---|---|---|
select | [node: BlessTreeNode, path: string] |