From c2971eca0de51188fce0d64f2762bd6c91bdc7a4 Mon Sep 17 00:00:00 2001 From: Nexmoe <16796652+nexmoe@users.noreply.github.com> Date: Sat, 4 May 2024 13:28:12 +0800 Subject: [PATCH] feat(module): Update image source handling (#121) Added logic to check for props.module.s3Key and set the image source accordingly in Image.vue and Project.vue components. Cover image is now used if available; otherwise, the default image src is used. --- components/module/Image.vue | 3 ++- components/module/Project.vue | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/components/module/Image.vue b/components/module/Image.vue index 1419a2a..947e728 100644 --- a/components/module/Image.vue +++ b/components/module/Image.vue @@ -14,6 +14,7 @@ interface Props { const props = defineProps() const flow = inject('flow') as FlowOutput const text = computed(() => extractTextFromHTML(props.module.content)) +const cover = props.module.s3Key ? `https://space.r2.102415.xyz/${props.module.s3Key}` : props.module.image