Test vue-select 2
by hyeyoon
HTML
<script src="https://unpkg.com/vue@latest"></script>
<script src="https://unpkg.com/vue-select@latest"></script>
<div id="app">
<v-select
multiple
:debounce="250"
:options="options"
:placeholder="placeholder"
v-model="message"
taggable
>
</v-select>
{{$data}}
<!--:on-search="getOptions" -->
</div>
JavaScript
Vue.component('v-select', VueSelect.VueSelect)
new Vue({
el: '#app',
data: {
message: null,
options: ['foo','bar','baz'],
placeholder: 'Choose countries...'
},
methods: {
getOptions: function(search, loading) {
console.log('$refs', this.$refs)
console.log('$refs.select', this.$refs.select)
let s = this.$refs.select.search
console.log(s);
this.options.push(s)
this.$refs.select.select(s)
}
}
});