Props
| Name | Description |
|---|---|
expandable Type: BbTreeExpandable<Meta> | Defines nodes as expandable. It can be a global boolean, or a function that receives the node, its depth, and its parent and returns a boolean. Without it nothing is expandable: the tree renders fully expanded and static, which is the answer to "my chevrons do nothing". The everyday form is |
expandedItems Type: any[]Default[] | Live expansion state: the list of expanded node values (see |
items requiredType: BbTreeItem<Meta>[]Default[] | Tree-like structure of nodes to render. Use the fixed |
itemValue requiredType: ItemAccessor<Meta> | A node's identity, the field telling nodes apart (e.g. Required: a key or a function of |
pt Type: PtMap<BbTreePtPart, "expanded"> | Passthrough, object form: the same keys as the |
pt:<part> Type: PtValue | Passthrough, attribute form: one attribute per part, |
v-model
Values kept in sync through v-model.
| Name | Description |
|---|---|
expandedItems Type: any[] | The live state, and the only way to change expansion from code — pushing a value opens that node, and the |
Events
| Name | Description |
|---|---|
update:expandedItems Type: (value: any[]): void | Emitted with the new value whenever Fires with the whole new list on every toggle. Bind the model and treat it as state rather than listening to this directly. See example |
Slots
The listed properties are the ones exposed to the slot scope.
| Name | Description |
|---|---|
<depth> Type: BbTreeNodeSlotProps<Meta> | Every node at one depth ( |
<depth>:children Type: BbTreeNodeSlotProps<Meta> | The children container of every node at one depth. Renders under leaves too, so guard branch-only markup with |
<value> Type: BbTreeNodeSlotProps<Meta> | One node, by its resolved The name is the identity in kebab-case: |
<value>:children Type: BbTreeNodeSlotProps<Meta> | One node's children container, stopping the recursion there; beats |
default Type: BbTreeNodeSlotProps<Meta> | Renders every node that no |
Renamed and removed
Names from v2 and from earlier 3.0 betas that no longer work, and what to write instead.
- slot
<x>-children<x>:childrenfails silently pt:item:openpt:item:expandedfails silentlypt:root:openpt:root:expandedfails silently