mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-01 05:54:03 +03:00
fix typeahead select
This commit is contained in:
+23
-3
@@ -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')
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 = "";
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user