Props
| Name | Type | Default | Description |
|---|---|---|---|
expandable | BbTreeExpandable<Meta> | undefined | - | 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 | any[] | undefined | [] | Live expansion state: the list of expanded node values (see |
itemsrequired | BbTreeItem<Meta>[] | [] | Tree-like structure of nodes to render. Use the fixed |
itemValue | ItemAccessor<Meta> | undefined | the whole `meta` object | Identity of a node, used to hash entries of Set stable identity before loading remote nodes. Otherwise a refetch can reset expansion and change per-node slot names. See example |
pt | PtMap<BbTreePtPart, "open"> | undefined | - | Passthrough, object form: the same keys as the |
pt:item | PtValue | undefined | - | |
pt:item:open | PtValue | undefined | - | |
pt:root | PtValue | undefined | - | |
pt:root:open | PtValue | undefined | - |
v-model
Values kept in sync through v-model.
| Name | Type | Description |
|---|---|---|
expandedItems | any[] | undefined | The live state, and the only way to change expansion from code — pushing a value opens that node, and the |
Events
| Name | Type | Description |
|---|---|---|
update:expandedItems | (event: "update:expandedItems", value: any[]): void | 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 | Type | Description |
|---|---|---|
<depth> | BbTreeNodeSlotProps<Meta> | Every node at one depth ( |
<depth>-children | BbTreeNodeSlotProps<Meta> | The children container of every node at one depth. Renders under leaves too, so guard branch-only markup with |
<value> | BbTreeNodeSlotProps<Meta> | One node, by its resolved The name is the identity normalized: |
<value>-children | BbTreeNodeSlotProps<Meta> | One node's children container, stopping the recursion there; beats |
default | BbTreeNodeSlotProps<Meta> | Renders every node that no |