Skip to content

Select

Basic usage

Disabled option

Set the value of disabled in dd-option to true to disable this option.

Disabled select

Disable the whole component.

Clearable single select

Set clearable attribute for dd-select

Bordered-less

Bordered-less style component.

Suffix

Basic multiple select

Set multiple attribute for dd-select to enable multiple mode. In this case, the value of v-model will be an array of selected options.

Filter Option

You can filter options for your desired ones. Adding 'show-search' to dd-select enables filtering. filter-option is a Function that gets called when the input value changes, and its parameter is the current input value.

Custom template

Insert customized HTML templates into the slot of dd-option.

Enter keywords and search data from server.

Big Data

dd-select use virtual scroll

Select API

Select Attributes

NameDescriptionTypeDefaultVersion
value(v-model)binding valuestring | number | string[] | number[]
optionscustom render option{ value: any; label?: any; disabled?: boolean; title?: any }[]
showSearchWhether select is searchablebooleanfalse
placeholderplaceholder of Inputstring
disabledwhether Input is disabledbooleanfalse
sizesize of Selectlarge | default | small
filterOptionFilter based on input itemsFunction(inputValue, option)true
multiplewhether multiple-select is activatedbooleanfalse
clearablewhether select can be clearedbooleanfalse
maxTagCountMax tag count to shownumber
borderedBordered-lessbooleanfalse
generategenerate component examples immediatelybooleanfalse

Select Events

NameDescriptionType
changeonly if the modelValue has changed(value, option) => void
selectCalled when a option is selected(value, option) => void
searchCallback function that is fired when input changed.(value) => void
deselectCalled when a option is deselected,only called for multiple(value, option) => void
remove-tagCalled when a tag is removed ,only called for multiple(value, option) => void
inputCalled when input changed(value) => void
clearCalled when the clear icon is clicked in a clearable Select() => void
dropdown-visible-changeCalled when the dropdown appears/disappears(visible) => void
blurCalled when input blurs(e) => void
focusCalled when input focuses(e) => void

Select Slots

NameDescription
dropdownRenderCustomize dropdown content
suffixIconThe custom suffix icon

Contributors

lazy

ChangeLog

cebe3 - fix: 修复select宽度问题 on 3/13/2025
bdfd0 - style: 修正样式 on 1/10/2024
01562 - style: 修正placeholder样式 on 1/10/2024
40905 - feat: 增加是否立即生成组件 on 1/3/2024
b4de2 - style: 修正icon样式 on 12/26/2023
1f9ff - style: 修改内边距 on 11/30/2023
f9517 - style: 修正select样式写法 on 11/21/2023
de8ee - style: 隐藏无边框模式阴影 on 11/20/2023
3244b - feat: select on 11/17/2023

Released under the MIT License.