mirror of
https://github.com/robonen/lorem-blog.git
synced 2026-03-20 10:54:38 +00:00
feat(blog): implement BlogHeader and BlogList components, add post fetching and filtering logic
This commit is contained in:
@@ -1,3 +1,17 @@
|
||||
<script setup lang="ts">
|
||||
import { BlogHeader, useProvidingPosts } from '@/widgets/Blog';
|
||||
import { BlogList} from '@/widgets/Blog';
|
||||
|
||||
useProvidingPosts(() => fetch('/posts.json').then((response) => {
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch posts');
|
||||
}
|
||||
|
||||
return response.json();
|
||||
}));
|
||||
</script>
|
||||
|
||||
<template>
|
||||
Blog
|
||||
<BlogHeader />
|
||||
<BlogList />
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user