A vue version of bootstrap select
npm install @alfsnd/vue-bootstrap-select --saveimport VSelect from '@alfsnd/vue-bootstrap-select'
export default {
name: 'app',
components: {
VSelect
},
data() {
return {
selectedValue: null
};
}
}<template>
<div id="app">
<v-select :options="[{value: 1, text: 'Item 1'}, {value: 2, text: 'Item 2'}]" v-model="selectedValue" />
</div>
</template>The options prop accepts arrays of strings
<v-select :options="['Item 1', 'Item 2']" />And arrays of objects
<v-select :options="[{value: 1, text: 'Item 1'}, {value: 2, text: 'Item 2'}]" />