Logo

Form Select

<div>
   <b-form-select v-model="selected" :options="options"></b-form-select>
   <b-form-select v-model="selected" :options="options" size="sm" class="mt-3"></b-form-select>

   <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
 </div>

Generate your select options by passing an array or object to the options props:

Selected:

Selected:

Options and optgroups

<div>
   <b-form-select v-model="selected" class="mb-3">
     <option :value="null">Please select an option</option>
     <option value="a">Option A</option>
     <option value="b" disabled>Option B (disabled)</option>
     <optgroup label="Grouped Options">
       <option :value="{ C: '3PO' }">Option with object value</option>
       <option :value="{ R: '2D2' }">Another option with object value</option>
     </optgroup>
   </b-form-select>

   <div class="mt-2">Selected: <strong>{{ selected }}</strong></div>
 </div>
Selected:

Changing the option field names

<div>
   <b-form-select
     v-model="selected"
     :options="options"
     class="mb-3"
     value-field="item"
     text-field="name"
     disabled-field="notEnabled"
   ></b-form-select>
   <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
 </div>

If you want to customize the field property names (for example using name field for display text) you can easily change them by setting the text-field, html-field, value-field, and disabled-field props to a string that contains the property name you would like to use:

Selected: A

Value in single mode

<div>
   <b-form-select v-model="selected" :options="options"></b-form-select>
   <div class="mt-3">Selected: <strong>{{ selected }}</strong></div>
 </div>

In non multiple mode, <b-form-select> returns the a single value of the currently selected option.

Selected: