Skip to content

Select

te-select is a native <select>. Options can be plain values or objects.

Objects and plain values

vue
<te-select :options="[{ id: 1, label: 'One' }, { id: 2, label: 'Two' }]" placeholder="Pick one" />
<te-select :options="['Red', 'Green', 'Blue']" placeholder="Pick a colour" />

Sizes and multiple

vue
<te-select size="small" :options="['One', 'Two']" />
<te-select size="large" :options="['One', 'Two']" />
<te-select multiple :options="['One', 'Two', 'Three']" />

Falsy values

An option whose value is 0 or '' is kept as-is. The old implementation used option[valueField] || option, which quietly replaced those with the whole option object.

Props

PropTypeDefaultDescription
modelValuestring | number | array | nullnullSupports v-model. An array with multiple.
options(object | string | number)[][]Option list.
displayFieldstring'label'Object key holding the visible text.
valueFieldstring'id'Object key holding the value.
placeholderstring''Shown as a disabled first option. Ignored with multiple.
size'small' | 'medium' | 'large''medium'Padding and font size.
multiplebooleanfalseAllows several selections.
disabledbooleanfalseDisables the field.

Events

EventPayloadDescription
update:modelValuestring | number | arraySelection changed.

Released under the MIT License.