Skip to content

Ap-InputSelect

InputSelect is an input component , is used to choose an item from a collection of options

Example

ts
     <apInputSelect v-model="selectedCity" :options="selectOptions"  />

Props

NameTypeDefaultRequired
modelValueAnynullfalse
optionsArrayfalsetrue
disabledBooleanfalsefalse
optionLabelstringundefinedfalse

Value and options

Component use v-model property with options collection. Label is define with optionLabel

ts
const selectOptions = ref([
  { name: 'choix 1', code: '1' },
  { name: 'choix 2', code: '2' },
  { name: 'choix 3', code: '3' },
  { name: 'choix 4', code: '4' },
  { name: 'choix 5', code: '5' }
]);
<apInputSelect v-model="selectedCity" :options="selectOptions"  optionLabel="name" size="medium"/>
<apInputSelect v-model="selectedCity" :options="selectOptions"  optionLabel="code" size="medium"/>

TIP

when options are simple primitive values such as a string array, no optionLabel would be necessary.