feat: 首页改版
This commit is contained in:
35
src/components/IndexView.astro
Normal file
35
src/components/IndexView.astro
Normal file
@@ -0,0 +1,35 @@
|
||||
---
|
||||
import type {Post, CategoriesStats} from "@/types/post";
|
||||
import IndexSidebar from "@/components/IndexSidebar.astro";
|
||||
import PostList from '@/components/PostList.astro'
|
||||
|
||||
interface Props {
|
||||
posts: Post[]
|
||||
page: number
|
||||
totalPage: number
|
||||
categories: CategoriesStats[]
|
||||
}
|
||||
|
||||
const {posts, page, totalPage, categories} = Astro.props
|
||||
---
|
||||
|
||||
<div class="container">
|
||||
<PostList posts={posts} page={page} totalPage={totalPage}/>
|
||||
|
||||
<IndexSidebar categories={categories}/>
|
||||
</div>
|
||||
|
||||
<style>
|
||||
.container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
gap: 28px;
|
||||
}
|
||||
|
||||
@media (max-width: 860px) {
|
||||
.container{
|
||||
flex-direction: column-reverse;
|
||||
gap: 16px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user