refactor: filter页面使用图片懒加载组件

This commit is contained in:
2026-08-13 12:10:10 +08:00
parent 60131d6fa9
commit a99c165ba3

View File

@@ -6,6 +6,7 @@ import Folder from "@/assets/icon/folder.png?url";
import { formatDatetime } from "@/lib/format.ts";
import { createHttp } from "@/lib/request";
import type { CategoriesStats, Post, Tag } from "@/types";
import LazyImage from "@/components/LazyImage.astro";
const http = createHttp(Astro.request.headers);
@@ -144,7 +145,7 @@ const isActive = (targetType: string, targetCode: string) =>
<li class="post-card">
<a class="post-cover" href={`/post/${post.slug}`} aria-label={post.title}>
{post.cover ? (
<img src={post.cover} alt={post.title} loading="lazy" />
<LazyImage src={post.cover} alt={post.title} />
) : (
<span class="cover-placeholder">{post.title[0]}</span>
)}
@@ -343,7 +344,6 @@ const isActive = (targetType: string, targetCode: string) =>
font-size: 40px;
color: #fff;
overflow: hidden;
background: linear-gradient(135deg, #4f6df5, #7b5cf0);
}
.post-cover img {