mirror of
https://github.com/tenrok/vue-select.git
synced 2026-06-16 09:10:33 +03:00
fix typeahead select
This commit is contained in:
@@ -1,9 +1,11 @@
|
|||||||
# vue-select
|
# 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
|
#### 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'}]`
|
- options param accepts simple arrays, and arrays of objects: `['foo','bar']` or `[{label: 'Foo', value: 'foo'}, {label: 'Bar', value: 'bar'}]`
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-4
File diff suppressed because one or more lines are too long
+23
-3
@@ -2,14 +2,33 @@
|
|||||||
<div id="app" class="container">
|
<div id="app" class="container">
|
||||||
|
|
||||||
<h1>Vue Select</h1>
|
<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="row">
|
||||||
<div class="col-md-6">
|
<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>
|
</div>
|
||||||
|
|
||||||
<pre class="col-md-6">{{ select | json }}</pre>
|
<div class="col-md-6">
|
||||||
|
<pre><strong>Selected:</strong>{{ select | json }}</pre>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -23,6 +42,7 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
select: [],
|
select: [],
|
||||||
|
multiple: true,
|
||||||
options: require('./countries.js')
|
options: require('./countries.js')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
},
|
},
|
||||||
searchable: {
|
searchable: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: false
|
||||||
},
|
},
|
||||||
multiple: {
|
multiple: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
@@ -246,8 +246,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
typeAheadSelect() {
|
typeAheadSelect() {
|
||||||
var option = this.filteredOptions[ this.typeAheadPointer ];
|
this.select( this.filteredOptions[ this.typeAheadPointer ] );
|
||||||
this.select( this.getOptionValue(option) );
|
|
||||||
this.search = "";
|
this.search = "";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user