Vue Select fields components are used for collecting user provided information from a list of options.
Note: Read the API tab to find all available options and advanced customization
Basic exampleSelect options are added using v-model with the options
argument. You can get selected values in two ways. The first is to filter the data given in v-model:options
by a selected
key. The second method is to use v-model:selected
which is read-only and stores the currently selected options as a string (single select) or as an array (multiple select).
Basic select behaves like a native one and by default marks the first available option as selected. To change this setting, easily set the preselect
property to false
.
Add multiple
property to the select component to activate multiple mode.
It is possible to add select label by setting the label
property.
Use placeholder
property to set placeholder for select input. The placeholder will be displayed when input is focused and no option is selected.
Add disabled
attribute to the select component to disable select input.
Use disabled
key on option element to disable specific option.
Set clearButton
property to display the button that will allow to clear current selections.
Custom content will be displayed at the end of the select dropdown.
Visible optionsUse visibleOptions
property to change the number of options that will be displayed in the select dropdown without scrolling.
Add secondary-text
key to the specific options to display secondary text.
Set filter
property to enable options filtering.
It is possible to group options by using optgroup
key.
Add icon
property to the specific options to display the option icon.
Set isValidated
and isValid
properties to enable component validation. The validFeedback
and invalidFeedback
options allow to modify the validation messages. Validate
method can be set on select's change
event.
You can create custom rules and show the validation results via isValidated
and isValid
properties.
The setValue
method allows to programatically set the component selections.
Add single value string to the arguments list to correctly select option with corresponding value in single selection mode.
Multi selectionAdd array of string values to the arguments list to correctly select options with corresponding values in multi selection mode.
Select with toggle elementIf you want to toggle Select via button, you have to add toggle
/ open
/ close
function from MDBSelect ref and pin her to this button.
Set autoSelect
option to true
to enable selecting on Tab press.
Add the first option with the hidden and selected attributes and an empty value to leave select with no selection.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4