Fixing the invisibles posts

This commit is contained in:
2021-04-20 12:57:52 +02:00
parent 4014ffd5d1
commit 733d5eec2e
24 changed files with 128 additions and 887 deletions

View File

@@ -30,29 +30,14 @@
</template>
<script lang="ts">
import {useAsync, useContext} from "@nuxtjs/composition-api";
import {Post} from "../../@types/types";
import {defineComponent} from "@nuxtjs/composition-api";
export default {
export default defineComponent({
name: "PostsHome",
setup() {
const { $content, i18n } = useContext()
const posts = useAsync(() => {
return $content(`articles/${i18n.locale}`)
.sortBy('date', 'asc')
.limit(3)
.fetch<Post>()
})
const debug = () => {
console.log(posts)
}
return {
posts,
debug
props: {
posts: {
default: () => [],
}
}
}
})
</script>