2026-01-25 23:51:43 +08:00
|
|
|
<script setup>
|
|
|
|
|
import ArticleCard from './ArticleCard.vue'
|
|
|
|
|
|
|
|
|
|
defineProps({
|
|
|
|
|
categories: {
|
|
|
|
|
type: Array,
|
|
|
|
|
required: true
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div class="category-index">
|
2026-02-01 23:42:12 +08:00
|
|
|
<div
|
|
|
|
|
v-for="(category, index) in categories"
|
|
|
|
|
:key="index"
|
|
|
|
|
class="category-section"
|
|
|
|
|
>
|
2026-02-18 17:38:10 +08:00
|
|
|
<h2
|
|
|
|
|
v-if="category.title"
|
|
|
|
|
class="category-title"
|
|
|
|
|
>
|
|
|
|
|
{{ category.title }}
|
|
|
|
|
</h2>
|
|
|
|
|
<p
|
|
|
|
|
v-if="category.description"
|
|
|
|
|
class="category-desc"
|
|
|
|
|
>
|
2026-02-01 23:42:12 +08:00
|
|
|
{{ category.description }}
|
|
|
|
|
</p>
|
|
|
|
|
|
2026-01-25 23:51:43 +08:00
|
|
|
<div class="card-grid">
|
|
|
|
|
<ArticleCard
|
|
|
|
|
v-for="(item, i) in category.items"
|
|
|
|
|
:key="i"
|
|
|
|
|
v-bind="item"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
.category-index {
|
2026-03-16 00:26:59 +08:00
|
|
|
margin-top: 28px;
|
2026-01-25 23:51:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.category-section {
|
2026-03-16 00:26:59 +08:00
|
|
|
margin-bottom: 52px;
|
2026-01-25 23:51:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.category-title {
|
2026-03-16 00:26:59 +08:00
|
|
|
font-size: 1.65rem;
|
2026-01-25 23:51:43 +08:00
|
|
|
font-weight: 700;
|
2026-03-16 00:26:59 +08:00
|
|
|
margin-bottom: 10px;
|
2026-01-25 23:51:43 +08:00
|
|
|
border-bottom: none;
|
2026-03-16 00:26:59 +08:00
|
|
|
letter-spacing: -0.02em;
|
2026-01-25 23:51:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.category-desc {
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
color: var(--vp-c-text-2);
|
2026-03-16 00:26:59 +08:00
|
|
|
margin-bottom: 20px;
|
|
|
|
|
line-height: 1.68;
|
2026-01-25 23:51:43 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-grid {
|
|
|
|
|
display: grid;
|
2026-03-16 00:26:59 +08:00
|
|
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
|
|
|
gap: 18px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media (max-width: 768px) {
|
|
|
|
|
.category-section {
|
|
|
|
|
margin-bottom: 38px;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.category-title {
|
|
|
|
|
font-size: 1.4rem;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.card-grid {
|
|
|
|
|
grid-template-columns: 1fr;
|
|
|
|
|
gap: 14px;
|
|
|
|
|
}
|
2026-01-25 23:51:43 +08:00
|
|
|
}
|
|
|
|
|
</style>
|