fix: 改用 style 传 height

This commit is contained in:
Femoon
2023-10-23 10:03:40 +08:00
parent 9d6e6d76d3
commit 000077ca1a
2 changed files with 1 additions and 2 deletions

View File

@@ -60,7 +60,6 @@ export default function LazyImage({
ref: imageRef,
src: imageLoaded ? src : placeholderSrc,
alt: alt,
style: src ? style : { height: '0px', ...style },
onLoad: handleImageLoad
}

View File

@@ -31,7 +31,7 @@ const BlogPostCard = ({ post, showSummary }) => {
}>
<div>
{CONFIG.POST_LIST_COVER && <div className='w-full max-h-96 object-cover overflow-hidden mb-2'>
<LazyImage src={post.pageCoverThumbnail} className='w-full max-h-96 object-cover hover:scale-125 duration-150' />
<LazyImage src={post.pageCoverThumbnail} style={post.pageCoverThumbnail ? {} : { height: '0px' }} className='w-full max-h-96 object-cover hover:scale-125 duration-150' />
</div>}
{post.title}
</div>