import { CalendarOutlined } from '@antdv-next/icons'; import { computed, defineComponent } from 'vue'; import { RouterLink } from 'vue-router'; import BlogLayout from '@/components/blog/BlogLayout'; import { useBlogArticles } from '@/hooks/useBlogArticles'; export default defineComponent({ name: 'BlogArchivePage', setup() { const { articles } = useBlogArticles(); const groupedArticles = computed(() => { const groups = new Map(); articles.value.forEach((article) => { const key = article.date.slice(0, 7); groups.set(key, [...(groups.get(key) ?? []), article]); }); return Array.from(groups.entries()); }); return () => (
{groupedArticles.value.map(([month, monthArticles]) => (

{month}

{monthArticles.map((article) => (
{article.date.slice(5)}
{article.title}
))}
))}
); }, });