1
0
mirror of https://github.com/TeamPiped/Piped.git synced 2024-12-17 07:40:27 +05:30
Piped/src/components/TrendingPage.vue

46 lines
1.1 KiB
Vue
Raw Normal View History

2020-11-17 10:45:35 +05:30
<template>
<h1 class="uk-text-bold uk-text-center">Trending</h1>
<hr />
2020-11-22 10:05:16 +05:30
<div class="uk-grid-xl" uk-grid="parallax: 0">
2020-11-17 10:45:35 +05:30
<div
:style="[{ background: backgroundColor }]"
2020-11-18 19:10:04 +05:30
class="uk-width-1-2 uk-width-1-3@s uk-width-1-4@m uk-width-1-5@l uk-width-1-6@xl"
2020-11-17 10:45:35 +05:30
v-bind:key="video.url"
v-for="video in videos"
>
2021-06-17 00:44:46 +05:30
<VideoItem :video="video" height="118" width="210" />
2020-11-17 10:45:35 +05:30
</div>
</div>
</template>
<script>
2021-06-17 00:44:46 +05:30
import VideoItem from "@/components/VideoItem.vue";
2020-11-17 10:45:35 +05:30
export default {
data() {
return {
videos: [],
2020-11-17 10:45:35 +05:30
};
},
mounted() {
document.title = "Trending - Piped";
let region = this.getPreferenceString("region", "US");
this.fetchTrending(region).then(videos => (this.videos = videos));
2020-11-17 10:45:35 +05:30
},
methods: {
async fetchTrending(region) {
return await this.fetchJson(this.apiUrl() + "/trending", {
region: region || "US",
});
},
},
2021-06-17 00:44:46 +05:30
components: {
VideoItem,
},
2020-11-17 10:45:35 +05:30
};
</script>