2022-03-19 19:31:43 +00:00
|
|
|
<template>
|
|
|
|
<div>
|
|
|
|
<!-- Video Loading Animation -->
|
|
|
|
<center v-if="recommends.length == 0">
|
|
|
|
<v-skeleton-loader type="card-avatar, article, actions" />
|
|
|
|
<v-skeleton-loader type="card-avatar, article, actions" />
|
|
|
|
</center>
|
|
|
|
|
2022-03-23 11:21:06 +00:00
|
|
|
<v-list-item v-for="(video, index) in recommends" :key="index" class="pa-0">
|
|
|
|
<component
|
2022-03-23 13:07:03 +00:00
|
|
|
v-if="getComponents()[Object.keys(video)[0]]"
|
2022-03-23 11:21:06 +00:00
|
|
|
:is="Object.keys(video)[0]"
|
|
|
|
:key="video[Object.keys(video)[0]].videoId"
|
|
|
|
:video="video[Object.keys(video)[0]]"
|
|
|
|
></component>
|
2022-03-19 19:31:43 +00:00
|
|
|
</v-list-item>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2022-03-23 13:07:03 +00:00
|
|
|
import compactVideoRenderer from "./VideoRenderers/compactVideoRenderer.vue";
|
2022-03-23 11:21:06 +00:00
|
|
|
import gridVideoRenderer from "./VideoRenderers/gridVideoRenderer.vue";
|
|
|
|
|
2022-03-19 19:31:43 +00:00
|
|
|
export default {
|
2022-03-23 11:21:06 +00:00
|
|
|
components: {
|
|
|
|
gridVideoRenderer,
|
2022-03-23 13:07:03 +00:00
|
|
|
compactVideoRenderer,
|
2022-03-23 11:21:06 +00:00
|
|
|
},
|
2022-03-20 09:50:13 +00:00
|
|
|
props: {
|
|
|
|
recommends: Array,
|
2022-03-19 19:31:43 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
parseBottom(video) {
|
|
|
|
const bottomText = [video.channel, video.metadata.views];
|
|
|
|
if (video.metadata.published) bottomText.push(video.metadata.published);
|
|
|
|
return bottomText.join(" • ");
|
|
|
|
},
|
2022-03-23 13:07:03 +00:00
|
|
|
|
|
|
|
getComponents() {
|
|
|
|
return this.$options.components;
|
|
|
|
},
|
2022-03-19 19:31:43 +00:00
|
|
|
},
|
|
|
|
};
|
2022-03-21 23:47:11 +00:00
|
|
|
</script>
|