2022-03-03 18:05:50 +00:00
|
|
|
<template>
|
2022-03-22 01:13:48 +00:00
|
|
|
<div class="accent">
|
|
|
|
<center v-if="videos.length == -1">
|
2022-03-17 21:54:06 +00:00
|
|
|
<v-skeleton-loader type="card-avatar, article, actions" />
|
|
|
|
<v-skeleton-loader type="card-avatar, article, actions" />
|
2022-03-04 14:32:09 +00:00
|
|
|
</center>
|
|
|
|
|
2022-03-23 13:07:03 +00:00
|
|
|
<horizontal-list-renderer :recommends="videos" />
|
2022-03-03 18:05:50 +00:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
2022-03-04 02:25:30 +00:00
|
|
|
<style scoped>
|
|
|
|
.entry {
|
2022-03-19 19:31:43 +00:00
|
|
|
width: 100%; /* Prevent Loading Weirdness */
|
2022-03-04 02:25:30 +00:00
|
|
|
}
|
2022-03-06 16:55:16 +00:00
|
|
|
.videoRuntimeFloat {
|
|
|
|
position: absolute;
|
2022-03-19 19:31:43 +00:00
|
|
|
bottom: 10px;
|
2022-03-06 16:55:16 +00:00
|
|
|
right: 10px;
|
|
|
|
background: rgba(0, 0, 0, 0.5);
|
2022-03-19 19:31:43 +00:00
|
|
|
border-radius: 5px;
|
2022-03-22 01:13:48 +00:00
|
|
|
padding: 0px 4px 0px 4px;
|
2022-03-06 16:55:16 +00:00
|
|
|
}
|
2022-03-04 02:25:30 +00:00
|
|
|
</style>
|
|
|
|
|
2022-03-03 18:05:50 +00:00
|
|
|
<script>
|
2022-03-23 13:07:03 +00:00
|
|
|
import horizontalListRenderer from "../components/horizontalListRenderer.vue";
|
2022-03-03 18:05:50 +00:00
|
|
|
export default {
|
2022-03-23 13:07:03 +00:00
|
|
|
components: { horizontalListRenderer },
|
2022-03-03 18:05:50 +00:00
|
|
|
data() {
|
|
|
|
return {
|
2022-03-21 05:13:21 +00:00
|
|
|
videos: [],
|
|
|
|
};
|
2022-03-03 18:05:50 +00:00
|
|
|
},
|
|
|
|
mounted() {
|
2022-03-22 12:25:29 +00:00
|
|
|
this.getSearch();
|
2022-03-22 08:23:23 +00:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getSearch() {
|
|
|
|
const searchQuestion = this.$route.query.q;
|
2022-03-23 13:07:03 +00:00
|
|
|
this.$youtube.search(searchQuestion).then((response) => {
|
|
|
|
this.videos = response.items;
|
2022-03-22 08:23:23 +00:00
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
// Watches for new searches while the current search page is active.
|
|
|
|
$route: {
|
|
|
|
deep: true,
|
|
|
|
handler(newSearch, oldSearch) {
|
|
|
|
if (newSearch.query.q != oldSearch.query.q) {
|
|
|
|
this.getSearch();
|
|
|
|
}
|
|
|
|
},
|
|
|
|
},
|
2022-03-21 05:13:21 +00:00
|
|
|
},
|
|
|
|
};
|
2022-03-03 18:05:50 +00:00
|
|
|
</script>
|