Skip to content

Tree ​

Brief Introduction ​

The Tree component is used to display hierarchical data structures, supporting expand/collapse, selection, checkbox, and other features. It can be used for organizational charts, file directories, categories, and similar scenarios.

Basic Usage ​

Basic tree structure display with node click event support.

Basic Usage
Root Node 1
Root Node 2
展开代码

Tree Selector ​

Tree selector supports single selection, multiple selection, filtering, and other features.

Single Selection Mode ​

Single Selection Mode
Please select▼
展开代码

Multiple Selection Mode ​

Multiple Selection Mode
Please select▼
展开代码

Checkbox Mode ​

Supports checkbox selection with parent-child linkage options.

Checkbox Mode
Please select▼
展开代码

Filtering ​

Supports input filtering for quick node lookup.

Filtering
Enter keyword▼
展开代码

Custom Styling ​

Supports custom text color, background color, and active color.

Custom Styling
请选择▼
展开代码

API Reference ​

Tree Props ​

PropDescriptionTypeOptionsDefault
dataTree dataarray—[]
propsConfiguration optionsobject—{}
default-expandedWhether to expand all nodes by defaultboolean—false
default-expanded-keysArray of keys for default expanded nodesarray—[]

Tree Events ​

Event NameDescriptionParameters
node-clickTriggered when a node is clickedClicked node data

TreeSelect Props ​

PropDescriptionTypeOptionsDefault
modelValue / v-modelBound valuestring / number / array—null
dataTree dataarray—[]
propsConfiguration optionsobject—{}
multipleWhether to support multiple selectionboolean—false
filterableWhether to support filteringboolean—false
placeholderPlaceholder textstring—Please select
defaultExpandedWhether to expand all nodes by defaultboolean—false
sizeSizestringdefault / small / largedefault
disabledWhether to disableboolean—false
clearableWhether to be clearableboolean—false
loadingWhether to show loading stateboolean—false
popperClassCustom class name for dropdownstring—''
classCustom class namestring—''
styleCustom stylesstring / object—''
defaultExpandedKeysArray of keys for default expanded nodesarray—[]
showCheckboxWhether nodes can be checkedboolean—false
checkStrictlyWhether checkbox is strict mode (parent-child not linked)boolean—false
defaultCheckedKeysArray of keys for default checked nodesarray—[]
textColorText colorstring—#606266
backgroundColorBackground colorstring—#fff
activeColorActive colorstring—#409eff
widthWidthstring / number—100%
heightHeightstring / number—auto
inputHeightInput box heightstring / number—32px
validateEventWhether to trigger form validationboolean—true
showArrowWhether to show arrowboolean—true
arrowTypeArrow typestring—arrow
arrowColorArrow colorstring—#909399

TreeSelect Events ​

Event NameDescriptionParameters
update:modelValueTriggered when value changesNew value
changeTriggered when value changesNew value
clearTriggered on clear—
check-changeTriggered when node checkbox state changes

Tree Props Configuration ​

PropDescriptionTypeDefault
labelProperty name for node labelstring'label'
childrenProperty name for node childrenstring'children'
valueProperty name for node valuestring'id'

Released under the MIT License.