Ap-InputSelect
InputSelect is an input component , is used to choose an item from a collection of options
Example
choix 1
choix 1
choix 1
ts
<apInputSelect v-model="selectedCity" :options="selectOptions" />
Props
Name | Type | Default | Required |
---|---|---|---|
modelValue | Any | null | false |
options | Array | false | true |
disabled | Boolean | false | false |
optionLabel | string | undefined | false |
Value and options
Component use v-model property with options collection. Label is define with optionLabel
choix 1
NY
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.
two