From 7ae86f515223f57c2cb3627115d295f3f86bf58e Mon Sep 17 00:00:00 2001 From: chenxuankai1 Date: Wed, 22 Jun 2022 15:18:32 +0800 Subject: [PATCH] image onError returns error message Signed-off-by: chenxuankai1 Change-Id: I993079de3dd0278804782454b3b41619e696a034 --- api/@internal/component/ets/image.d.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/api/@internal/component/ets/image.d.ts b/api/@internal/component/ets/image.d.ts index 49465ff58c..9b991825b7 100644 --- a/api/@internal/component/ets/image.d.ts +++ b/api/@internal/component/ets/image.d.ts @@ -163,6 +163,13 @@ declare class ImageAttribute extends CommonMethod { */ onError(callback: (event?: { componentWidth: number; componentHeight: number }) => void): ImageAttribute; + /** + * This callback is triggered when an exception occurs during image loading. + * The field of "message" carries the detailed information of failed image loading. + * @since 9 + */ + onError(callback: (event?: { componentWidth: number; componentHeight: number; message: string }) => void): ImageAttribute; + /** * When the loaded source file is a svg image, this callback is triggered when the playback of the svg image is complete. * If the svg image is a wireless loop image, this callback is not triggered. -- Gitee