2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-05-20 03:09:36 +03:00

fix typeahead select

This commit is contained in:
Jeff Sagal
2016-03-01 22:06:02 -08:00
parent 08b8e21ad9
commit f7b4e6e4f4
4 changed files with 33 additions and 12 deletions
+4 -2
View File
@@ -1,9 +1,11 @@
# vue-select
Rather than bringing in jQuery just to use Select2 or Chosen, this VueJS component provides similar functionality without the extra overhead of jQuery.
Rather than bringing in jQuery just to use Select2 or Chosen, this Vue.js component provides similar functionality without the extra overhead of jQuery.
#### Features
- typeahead auto-scompletion
- bootstrap styling
- typeahead auto-completion
- options param accepts simple arrays, and arrays of objects: `['foo','bar']` or `[{label: 'Foo', value: 'foo'}, {label: 'Bar', value: 'bar'}]`
+4 -4
View File
File diff suppressed because one or more lines are too long
+23 -3
View File
@@ -2,14 +2,33 @@
<div id="app" class="container">
<h1>Vue Select</h1>
<p class="lead">A simple component that provides similar functionality to Select2 without the overhead of jQuery.</p>
<div class="row">
<div class="col-md-6">
<v-select placeholder="choose something" :value.sync="select" :options="options" :multiple="true"></v-select>
<h3>Options</h3>
<div class="checkbox">
<label>
<input v-model="multiple" type="checkbox"> Allow Multiple
</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<v-select
placeholder="choose something"
:value.sync="select"
:options="options"
:multiple="multiple">
</v-select>
</div>
<pre class="col-md-6">{{ select | json }}</pre>
<div class="col-md-6">
<pre><strong>Selected:</strong>{{ select | json }}</pre>
</div>
</div>
</div>
</template>
@@ -23,6 +42,7 @@ export default {
data() {
return {
select: [],
multiple: true,
options: require('./countries.js')
}
}
+2 -3
View File
@@ -153,7 +153,7 @@
},
searchable: {
type: Boolean,
default: true
default: false
},
multiple: {
type: Boolean,
@@ -246,8 +246,7 @@
},
typeAheadSelect() {
var option = this.filteredOptions[ this.typeAheadPointer ];
this.select( this.getOptionValue(option) );
this.select( this.filteredOptions[ this.typeAheadPointer ] );
this.search = "";
},