0
0
Fork 0
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:
Front 2022-02-26 15:15:30 -05:00
parent a97b2825ad
commit ff3d92b838

View file

@ -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]
});
}
}