0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-12-22 08:20:17 +00:00

add $youtube.autoComplete()

This commit is contained in:
Kenny 2022-02-25 13:54:15 -05:00
parent a260d115a3
commit c05239f595
4 changed files with 36 additions and 3 deletions

3
.gitignore vendored
View file

@ -1,3 +1,4 @@
node_modules
nuxt/dist
dist
dist
package-lock.json

View file

@ -3,6 +3,29 @@
<v-text-field
label="Search"
outlined
v-model="text"
@input="textChanged"
/>
{{ response }}
</div>
</template>
<script>
export default {
data() {
return {
text: null,
response: null,
}
},
methods: {
textChanged() {
this.$youtube.autoComplete(this.text, (data) => {
this.response = data;
});
}
}
}
</script>

View file

@ -1,6 +1,14 @@
import { Http } from '@capacitor-community/http';
const module = {
test() {
return "success";
async autoComplete(text, callback) {
const options = {
url: 'https://suggestqueries-clients6.youtube.com/complete/search',
params: { client: 'youtube', q: text },
};
const response = await Http.request(options);
}
}

View file

@ -1,5 +1,6 @@
{
"dependencies": {
"@capacitor-community/http": "^1.4.1",
"@capacitor/android": "^3.4.0",
"@capacitor/cli": "^3.4.0",
"@capacitor/core": "^3.4.0"