v1.2.0
Theme

Tree Select

Select from hierarchical tree-structured data. Built on el-dm-select with the tree-data attribute.

Installation

npm install @duskmoon-dev/el-select

Usage

import '@duskmoon-dev/el-select/register';
<el-dm-select
  tree-data
  placeholder="Select department..."
  tree-options='[{"value":"eng","label":"Engineering","children":[...]}]'
></el-dm-select>

Live Demo

Default

Searchable with Clear

Multi-select Tree with Cascade

Disabled

Properties

PropertyTypeDefaultDescription
tree-databooleanfalseEnable tree-select mode
placeholderstring''Placeholder text when nothing is selected
disabledbooleanfalseDisable the select
searchablebooleanfalseEnable search filtering
clearablebooleanfalseShow clear button
cascadebooleanfalseAuto-select children when parent selected
check-strictlybooleanfalseIndependent parent/child selection
default-expand-allbooleanfalseExpand all tree nodes initially
multiplebooleanfalseEnable multi-select in tree mode
tree-optionsstring''JSON string of tree options
size'sm' | 'md' | 'lg''md'Size variant

Tree Option Format

interface TreeSelectOption {
  value: string;
  label: string;
  disabled?: boolean;
  children?: TreeSelectOption[];
}

Events

EventDescription
changeFired when selection changes
searchFired when search text changes
clearFired when cleared
expandFired when tree node expanded/collapsed