ITreeviewProvide

interface
Component Context

Context object provided by OrigamTreeview to all descendant OrigamTreeviewNode components via Vue inject. Exposes reactive state accessors and mutation handlers without prop-drilling.

TypeScript

Definition

The TypeScript interface definition as found in the origam source. Click the copy icon to copy the snippet.

typescript

API

Properties

Every property declared by this interface, with its type, optionality and default.

toggleExpanded
required
(id: string) => void
Expand or collapse the branch node with the given id.
toggleSelected
required
(id: string) => void
Select or deselect the node with the given id according to the current selectMode.
isExpanded
required
(id: string) => boolean
Returns true if the branch node with the given id is currently expanded.
isSelected
required
(id: string) => boolean
Returns true if the node with the given id is currently selected.
selectMode
required
ComputedRef<TTreeviewSelectMode>
Reactive selection strategy (none / single / multiple) forwarded from ITreeviewProps.
selectableNodes
required
ComputedRef<TTreeviewSelectableNodes>
Reactive filter controlling which node types (all / leaf / branch) can be selected.
showLines
required
ComputedRef<boolean>
Reactive flag controlling whether vertical guide lines are rendered.
expandOnClick
required
ComputedRef<boolean>
Reactive flag controlling whether a row click expands/collapses the branch.
color
required
ComputedRef<string | undefined>
Reactive color intent forwarded to child nodes for consistent selection highlight.

Ecosystem

Used by

Components and composables that extend or consume this interface.

Usage

Examples

Ready-to-paste code snippets using this interface.

Injecting the treeview context in a custom node renderer

typescript