Add lazy loading for images and videos in Chat
Some checks failed
Deploy with Docker Compose / deploy (push) Has been cancelled

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-25 03:10:18 +00:00
parent bbb493b544
commit d3e948d558

View File

@@ -152,12 +152,14 @@ onUnmounted(() => {
<img <img
v-if="isImageUrl(message.fileUrl)" v-if="isImageUrl(message.fileUrl)"
:src="message.fileUrl" :src="message.fileUrl"
loading="lazy"
class="w-full max-w-full max-h-48 rounded block" class="w-full max-w-full max-h-48 rounded block"
/> />
<video <video
v-else-if="isVideoUrl(message.fileUrl)" v-else-if="isVideoUrl(message.fileUrl)"
:src="message.fileUrl" :src="message.fileUrl"
controls controls
preload="none"
class="w-full max-w-full max-h-48 rounded block" class="w-full max-w-full max-h-48 rounded block"
/> />
<Link v-else bare :href="message.fileUrl" target="_blank" class="underline break-all">{{ <Link v-else bare :href="message.fileUrl" target="_blank" class="underline break-all">{{