From 22b4c4aaa5bbe852a09dfe6b8d3d4ffc145d01c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=89=E5=92=B2=E6=99=BA=E5=AD=90?= Date: Tue, 29 Nov 2022 13:01:51 +0800 Subject: [PATCH] fix: get attachment src url --- components/status/StatusAttachment.vue | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/status/StatusAttachment.vue b/components/status/StatusAttachment.vue index 168438d1..163ed698 100644 --- a/components/status/StatusAttachment.vue +++ b/components/status/StatusAttachment.vue @@ -6,6 +6,8 @@ const { attachment } = defineProps<{ attachment: Attachment }>() +const src = $computed(() => attachment.remoteUrl || attachment.url || attachment.previewUrl!) + const rawAspectRatio = computed(() => { if (attachment.meta?.original?.aspect) return attachment.meta.original.aspect @@ -60,14 +62,14 @@ const aspectRatio = computed(() => { focus:ring="2 primary inset" rounded-lg @click="openImagePreviewDialog({ - src: attachment.url || attachment.previewUrl!, + src, alt: attachment.description!, })" >