diff --git a/src/ui/components/FaImagePreview/index.vue b/src/ui/components/FaImagePreview/index.vue index 02e8d25fa..9ebb44309 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')