mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-11-22 19:25:16 +00:00
parse search to make it readable
This commit is contained in:
parent
a97b2825ad
commit
ff3d92b838
1 changed files with 8 additions and 3 deletions
|
@ -6,7 +6,11 @@
|
|||
v-model="text"
|
||||
@input="textChanged"
|
||||
/>
|
||||
{{ response }}
|
||||
<v-list style="min-width: 180px;">
|
||||
<v-list-item v-for="(item, index) in response" :key="index">
|
||||
<v-btn text style="width: 100%;" class="info--text">{{ item }}</v-btn>
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
@ -15,14 +19,15 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
text: null,
|
||||
response: null,
|
||||
response: [],
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
textChanged() {
|
||||
this.$youtube.autoComplete(this.text, (res) => {
|
||||
this.response = res.data;
|
||||
const data = res.data.replace(/^.*?\(/,'').replace(/\)$/,''); //Format Response
|
||||
this.response = JSON.parse(data)[1]
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue