Skip to content

TreeSelect

TreeSelect component combines a tree structure with a dropdown selector for hierarchical data selection.


Basic Usage

Single selection mode. Click on leaf nodes to select.

vue

<TTreeSelect :data="data" v-model="value" placeholder="Please select" />

Multiple Selection

Set multiple to enable checkbox-based multi-selection. Selecting a parent auto-selects children; partial selection shows indeterminate state.

vue

<TTreeSelect :data="data" v-model="values" multiple />

Leaf Only

Set leaf-only to restrict selection to leaf nodes only. Parent nodes toggle expand/collapse on click instead.

vue

<TTreeSelect :data="data" leaf-only placeholder="Please select" />

Filterable

Set filterable to enable search filtering — type to quickly locate nodes.

vue

<TTreeSelect :data="data" filterable placeholder="Search..." />

Collapse Tags

Set collapse-tags in multiple mode to display +N when more than 2 items are selected.

vue

<TTreeSelect :data="data" multiple collapse-tags />

API

Props

PropTypeDefaultDescription
dataTreeSelectOption[][]Tree option data
v-modelstring | number | (string | number)[]'' / []Selected value
multiplebooleanfalseMultiple selection mode
leaf-onlybooleanfalseSelect leaf nodes only
placeholderstring'Please select'Placeholder text
size'sm' | 'lg'Size
disabledbooleanfalseDisabled state
clearablebooleanfalseShow clear button
filterablebooleanfalseEnable search filter
collapseTagsbooleanfalseCollapse selected tags
defaultExpandAllbooleanfalseExpand all nodes by default
validation'valid' | 'invalid'Validation state
blockbooleanfalseFull width

Emits

EventParametersDescription
changevalueSelection changed

TreeSelectOption

PropertyTypeDescription
labelstringDisplay text
valuestring | numberOption value
childrenTreeSelectOption[]Child nodes
disabledbooleanDisabled state