From 66d8690238fa9f81edb1450163a062b982b9aab4 Mon Sep 17 00:00:00 2001 From: xingyu4j Date: Wed, 18 Jun 2025 15:16:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BD=93=E5=9B=BE=E7=89=87404=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E4=B8=8D=E8=83=BD=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/components/cropper/cropper-modal.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/web-antd/src/components/cropper/cropper-modal.vue b/apps/web-antd/src/components/cropper/cropper-modal.vue index a28fd6b4e..04b1f3627 100644 --- a/apps/web-antd/src/components/cropper/cropper-modal.vue +++ b/apps/web-antd/src/components/cropper/cropper-modal.vue @@ -44,6 +44,14 @@ const [Modal, modalApi] = useVbenModal({ if (isOpen) { // 打开时,进行 loading 加载。后续 CropperImage 组件加载完毕,会自动关闭 loading(通过 handleReady) modalLoading(true); + const img = new Image(); + img.src = src.value; + img.addEventListener('load', () => { + modalLoading(false); + }); + img.addEventListener('error', () => { + modalLoading(false); + }); } else { // 关闭时,清空右侧预览 previewSource.value = ''; @@ -208,7 +216,7 @@ async function handleOk() { >