-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.vue
45 lines (42 loc) · 890 Bytes
/
index.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<template>
<div>
<header class="grid justify-items-center bg-gray-900">
<h1 class="text-gray-300 font-semibold text-2xl py-4">Updated Posts</h1>
<Slider class="pb-4" />
<div class="grid justify-items-center bg-gray-900">
<h1 class="text-gray-300 text-lg mt-4">Posts</h1>
<div>
<PostCardMain
v-for="(post, index) in posts.all"
:key="`latest-${index}`"
:post="post"
class="m-8"
/>
</div>
</div>
</header>
</div>
</template>
<script>
export default {
data() {
return {
posts: {
all: [],
},
};
},
async fetch() {
const allPosts = await this.$content()
.sortBy("createdAt")
.limit(10)
.without(["body"])
.fetch();
this.posts = {
all: allPosts || [],
};
},
};
</script>
<style>
</style>