2
0
mirror of https://github.com/tenrok/vue-select.git synced 2026-06-10 07:52:23 +03:00

- add dev example

- rename `filterOptions` prop to `filterable`
- update tests
This commit is contained in:
Jeff
2017-12-09 09:50:30 -08:00
parent 283cb4f49b
commit 73e67a673b
4 changed files with 24 additions and 12 deletions
+2 -2
View File
@@ -526,7 +526,7 @@
* with taggable.
* @type {Boolean}
*/
filterOptions: {
filterable: {
type: Boolean,
default: true
},
@@ -915,7 +915,7 @@
* @return {array}
*/
filteredOptions() {
if (!this.filterOptions && !this.taggable) {
if (!this.filterable && !this.taggable) {
return this.mutableOptions.slice()
}
let options = this.mutableOptions.filter((option) => {
+12 -1
View File
@@ -17,13 +17,24 @@ new Vue({
placeholder: "placeholder",
value: null,
options: countries,
ajaxRes: []
ajaxRes: [],
people: []
},
methods: {
search(search, loading) {
loading(true)
this.getRepositories(search, loading, this)
},
searchPeople(search, loading) {
loading(true)
this.getPeople(loading, this)
},
getPeople: debounce((loading, vm) => {
vm.$http.get(`https://reqres.in/api/users?per_page=10`).then(res => {
vm.people = res.data.data
loading(false)
})
}, 250),
getRepositories: debounce((search, loading, vm) => {
vm.$http.get(`https://api.github.com/search/repositories?q=${search}`).then(res => {
vm.ajaxRes = res.data.items