TreeTable
Expandable rows on BlessTable
Rows that nest — a folder listing with sizes, a budget with sub-items — shown as a table with expandable rows. For a hierarchy without columns, use Tree.
It renders through Table, so columns, striping, row headers and cell slots all work the same. For a flat table, Table or DataTable.
Basic
| Name | Kind | Size |
|---|---|---|
| src | dir | 48 KB |
| components | dir | 40 KB |
| index.ts | file | 8 KB |
| docs | dir | 120 KB |
| README.md | file | 12 KB |
- The tree column (
treeColumn, first by default) carries the indent and a toggle named by the row's value, which says whether it's open. v-model:expanded(ordefaultExpanded) holds the open row ids;childrenKeynames the children field.
Usage
ts
import { BlessTreeTable } from "blessing-ui";API
Props
| Name | Type | Default | Description |
|---|---|---|---|
columns* | BlessColumn<T>[] | — | |
rows* | T[] | — | rows with an optional `children` array of the same shape |
rowKey* | keyof T & string | — | |
childrenKey | string | "children" | |
treeColumn | (keyof T & string) | — | column that carries the indent + toggle; default: first |
caption | string | — | |
striped | boolean | — | |
defaultExpanded | (string | number)[] | [] | ids expanded initially |
expanded | Id[] | — |
Events
| Name | Payload | Description |
|---|---|---|
update:expanded | [value: Id[] | undefined] |