From dccd1ddbae0bab7dca78b45b426286af5f48de2f Mon Sep 17 00:00:00 2001 From: dengnanhao Date: Wed, 8 Apr 2026 10:17:52 +0800 Subject: [PATCH] =?UTF-8?q?fix=20load=E3=80=81error=20event?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/preview/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/components/preview/index.ts b/components/preview/index.ts index 1fc3dce..c416dc6 100644 --- a/components/preview/index.ts +++ b/components/preview/index.ts @@ -193,9 +193,11 @@ async function Custom() { }; onError = () => { this.preview?.removeChild(this._loadingElement!); + this.dispatchEvent(new CustomEvent('error', { bubbles: true, composed: true })); }; onLoad = () => { this.preview?.removeChild(this._loadingElement!); + this.dispatchEvent(new CustomEvent('load', { bubbles: true, composed: true })); }; handleFile = async (file: string | File) => { try {