Skip to content

Multiselect

te-multiselect is a dropdown with search, select-all and either single or multiple selection. It closes on an outside click, so the plugin's v-click-outside directive has to be registered.

Multiple

vue
<te-multiselect
  v-model="picked"
  placeholder="Pick some"
  :options="[{ value: 1, text: 'One' }, { value: 2, text: 'Two' }, { value: 3, text: 'Three' }]"
/>

Single select

vue
<te-multiselect
  v-model="one"
  single-select
  placeholder="Pick one"
  :options="[{ value: 1, text: 'One' }, { value: 2, text: 'Two' }]"
/>

Props

PropTypeDefaultDescription
modelValuestring | number | arrayundefinedSupports v-model. An array unless singleSelect.
optionsobject[][]Option list.
displayFieldstring'text'Key holding the visible text.
valueFieldstring'value'Key holding the value.
singleSelectbooleanfalseOne selection instead of many.
searchablebooleantrueShows the search box.
showSelectAllbooleantrueShows the select-all checkbox.
clearablebooleantrueShows a clear button once something is selected.
visibleItemsnumber3How many labels to list before switching to a count.
placeholderstring''Placeholder of the closed field.
placeholderSearchstring'Search...'Placeholder of the search box.
minWidthstring | number'250px'Minimum width of the field.
listHeightstring | number'250px'Height of the scrolling list.
disabledbooleanfalseDisables the field.

Events

EventPayloadDescription
update:modelValuestring | number | arraySelection changed.

Slots

SlotPropsDescription
item{ option, key }Custom rendering for an option.

Released under the MIT License.