From 31ab5685630ea016447cd6f066ea0d64baa2903b Mon Sep 17 00:00:00 2001 From: Hooray <304327508@qq.com> Date: Wed, 5 Nov 2025 02:15:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8DFaImagePreview=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=9B=B4=E6=94=B9src=E5=80=BC=E5=90=8E=E4=B8=8D?= =?UTF-8?q?=E9=87=8D=E7=BD=AE=E5=8A=A0=E8=BD=BD=E7=8A=B6=E6=80=81=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/components/FaImagePreview/index.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ui/components/FaImagePreview/index.vue b/src/ui/components/FaImagePreview/index.vue index 02e8d25f..9ebb4430 100644 --- a/src/ui/components/FaImagePreview/index.vue +++ b/src/ui/components/FaImagePreview/index.vue @@ -21,6 +21,12 @@ const isLoading = ref(true) const isError = ref(false) const isOpen = ref(false) +// 监听 src 变化,重置加载状态 +watch(() => props.src, () => { + isLoading.value = true + isError.value = false +}, { immediate: false }) + function handleLoad() { isLoading.value = false emits('load')