Select     

A Quasar Select box can be of two types: single selection (using Radios or Lists) or multiple selection (using Checkboxes or Toggles). This component opens up a Popover. If for some reason you want it to open a Dialog, use the “sibling” Dialog Select component.

Basic Usage

<!-- Single Selection using Radios -->
<q-select
type="radio"
v-model="select"
:options="selectOptions"
></q-select>
<!-- Single Selection using List -->
<q-select
type="list"
v-model="select"
:options="selectOptions"
></q-select>
<!-- Multiple Selection using Checkboxes-->
<q-select
type="checkbox"
v-model="select"
:options="selectOptions"
></q-select>
<!-- Multiple Selection using Toggles-->
<q-select
type="toggle"
v-model="select"
:options="selectOptions"
></q-select>
<!-- Disabled state -->
<q-select
disable
type="checkbox"
v-model="select"
:options="selectOptions"
></q-select>

Options Object example:

selectOptions: [
{
label: 'Google',
value: 'goog'
},
{
label: 'Facebook',
value: 'fb'
},
...
]

Error State

Add has-error CSS class:

<q-select
class="has-error"
type="radio"
v-model="select"
:options="selectOptions"
></q-select>

Vue Properties

Vue PropertyRequiredDescription
optionsYesArray of options (Object with label and value properties).
typeYesOne of radio, list, checkbox or toggle strings.
label(Floating) Label to use.
placeholderPlaceholder to use.
static-labelOverrides label and placeholder and selected value. Display this label always regardless of selection status.
readonlyWhen set to true the model cannot be altered.
disableWhen set to true the model cannot be altered.

Vue Methods

Vue MethodDescription
open()Opens the Popover
close()Closes the Popover

Vue Events

Vue EventDescription
@inputTriggered on model value change with the new value.

Inside of a List Usage

<div class="list">
<div class="list-label">Single Selection</div>
<div class="item multiple-lines">
<i class="item-primary">supervisor_account</i>
<div class="item-content">
<q-select
class="full-width"
type="radio"
v-model="select"
:options="selectOptions"
></q-select>
</div>
</div>
<hr>
<div class="list-label">Multiple Selection</div>
<div class="item multiple-lines">
<i class="item-primary">supervisor_account</i>
<div class="item-content">
<q-select
class="full-width"
type="checkbox"
v-model="multipleSelect"
:options="selectOptions"
></q-select>
</div>
</div>
<div class="item multiple-lines">
<i class="item-primary">supervisor_account</i>
<div class="item-content">
<q-select
class="full-width"
type="toggle"
v-model="multipleSelect"
:options="selectOptions"
></q-select>
</div>
</div>
</div>