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

add ajax to docs

This commit is contained in:
Jeff Sagal
2016-06-15 20:34:38 -07:00
parent 480bfc1c5f
commit bfae6b3068
11 changed files with 430 additions and 56 deletions
+31
View File
@@ -0,0 +1,31 @@
<template>
<pre><v-code lang="markup">&lt;v-select
:debounce=&quot;250&quot;
:on-search=&quot;getOptions&quot;
:options=&quot;options&quot;
placeholder=&quot;Search GitHub Repositories...&quot;
label=&quot;full_name&quot;
&gt;
&lt;/v-select&gt;</v-code></pre>
<pre><v-code lang="javascript">data() {
return {
options: null
}
},
methods: {
getOptions(search, loading) {
loading(true)
this.$http.get('https://api.github.com/search/repositories', {
q: search
}).then(resp => {
this.options = resp.data.items
loading(false)
})
}
}
</v-code></pre>
</template>
<script type="text/babel">
export default {}
</script>