Skip to main content

CaInputSelect

A select input that works with v-model and has a native behavior on mobile devices

SASS-path: ./styles/components/atoms/ca-input-select.scss

Props

NameDescriptionTypeRequiredDefault
optionsShould be an array of objects containing 'label' and 'value' for every optionArraytrue-
labelThe from element labelStringfalse''
valueUse v-model to bind valueString / Numbertrue-
placeholderPlaceholder if no option is chosenStringfalse''
descriptionAdd a description under the selectStringfalse''
requiredIs it requiredBooleanfalsetrue
disabledUsed to disable the inputBooleanfalsefalse
iconName-Stringfalsechevron-down

Events

Event NameDescriptionParameters
inputTriggered by user input changeThe newly selected value (String, Number)
opened--

Methods

MethodDescriptionParameters
setInitialValueUsed to set initial value when mounted-
selectOptionThis is run to select an optionnew value (String, Number) and label (String - optional)
toggleOptionsOpening and closing the dropdown-
closeClosing the dropdown-
getLabelGet the label for a specific value in the list of optionsvalue (String, Number)