@alfsnd/vue-bootstrap-select
A vue version of bootstrap select.
Install
npm install @alfsnd/vue-bootstrap-select --save
Usage
import 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>
Passing options
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'}]" />