show loading wheel on search

This commit is contained in:
Kenny 2022-03-04 09:32:09 -05:00
parent 18b6e78012
commit 2c60c8c6cf
2 changed files with 14 additions and 4 deletions

View File

@ -1,10 +1,11 @@
<template>
<v-app>
<center>
<v-icon size="100">mdi-alert-circle</v-icon>
<h1 class="grey--text">An error occured!</h1>
<v-btn to="/">Reload Application</v-btn>
<v-btn to="/logs">Show Logs</v-btn>
<div style="margin-top: 5em; color: #999; font-size: 0.75em;">
@ -12,7 +13,7 @@
<div>Code: {{ error.statusCode }}</div>
<div>Path: {{ this.$route.fullPath }}</div>
</div>
</center>
</v-app>
</template>

View File

@ -1,5 +1,14 @@
<template>
<div>
<center style="padding-top: 3em;" v-if="videos == null">
<v-progress-circular
size="50"
indeterminate
color="primary"
/>
</center>
<v-list-item v-for="(video, index) in videos" :key="index">
<v-card class="entry">
<v-card-title v-text="video.raw.compactVideoRenderer.title.runs[0].text" />
@ -25,14 +34,14 @@
export default {
data() {
return {
videos: []
videos: null
}
},
mounted() {
const searchQuestion = this.$route.query.q
const vm = this;
this.$youtube.search(searchQuestion, (data) => {
console.log(data)
vm.videos = data;
})
}