Data display
Tree view
A hierarchy of links: the ancestor path down to the current node, then its children in branches that open and load the first time they open.
import { EcoTreeView } from "vue-ecosphere"
Ancestor path, current node and loaded branches
Open York (it loads) or Hull (it fails once; Retry). “Show 2 more” appends a page, including a branch that comes back empty.
Hierarchy
- Northwind UKParent
- North regionCurrent
Showing 3 of 5 branches
Depth limit and a repeated unit
A node that repeats among its own ancestors never gets a toggle, so a cycle cannot loop requests.
Open this unit to explore deeper levels.
This unit repeats in the hierarchy, so it is not expanded again.
Narrow container
tree--tight for a drawer or side panel on a wide screen.
- Northwind UKParent
- North regionCurrent
Showing 3 of 5 branches
Selection widget
Tab into the tree, then use the arrow keys: Right opens or moves in, Left closes or moves to the parent, Enter or Space selects.
Move 12 vehicles to
- Leeds branch
- Leeds Central depot
- Kirkstall depot
- Morley depot
- York branch
Selected: Kirkstall depot
API
| Name | Type | Default | Description |
|---|---|---|---|
nodes | EcoTreeNode[] | — | { id, label, href?, meta?, icon?, badges?, current?, path?, note?, children?, hasChildren?, state?, stateText?, more?, selectable? }. |
v-model:expanded | string[] | [] | Open branches. Keep it in the URL; open the current node by default. |
label / labelledby | string | — | Whose hierarchy this is (“Hierarchy of North region”). |
tight | boolean | false | Narrow-container spacing (tree--tight) for drawers and side panels. |
maxDepth | number | 8 | Past this depth, nodes with children show a note instead of a toggle. |
selectable | boolean | false | Selection widget on the ARIA tree pattern: role="tree", roving tabindex, arrows, Home/End, type-ahead, Enter/Space. |
v-model:selected | string | string[] | null | null | Selected node id (an array with multiple). |
multiple / selectParents | boolean | false | Several selections; let nodes with children be selected too. |
@toggle | (node, open) => void | — | A branch opened or closed — load it the first time it opens. |
@retry / @more / @select | (node) => void | — | Retry a failed branch, append the next page, an item was selected. |