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 {