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:
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user