From 27094f0db91972a8c7d8e16356a3c62434e09579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=BB=E4=BC=9Fx?= Date: Mon, 27 May 2024 16:24:19 +0800 Subject: [PATCH] =?UTF-8?q?ImageKnife=E6=8F=90=E4=BE=9B=E5=9B=BE=E7=89=87?= =?UTF-8?q?=E5=8A=A0=E8=BD=BD=E6=88=90=E5=8A=9F=E5=A4=B1=E8=B4=A5=E7=9A=84?= =?UTF-8?q?=E4=BA=8B=E4=BB=B6README=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 任伟x --- README.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/README.md b/README.md index 64cd223..dbe3f5a 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,29 @@ ImageKnifeComponent({ ImageKnifeOption: }).width(100).height(100) ``` +#### 8.监听图片加载成功与失败 + +``` +ImageKnifeComponent({ ImageKnifeOption: +{ + loadSrc: $r("app.media.rabbit"), + onLoadListener:{ + onLoadStart:()=>{ + this.starTime = new Date().getTime() + console.info("Load start: "); + }, + onLoadFailed: (err) => { + console.error("Load Failed Reason: " + err + " cost " + (new Date().getTime() - this.starTime) + " milliseconds"); + }, + onLoadSuccess: (data) => { + console.info("Load Successful: cost " + (new Date().getTime() - this.starTime) + " milliseconds"); + return data; + }, + } + } +}).width(100).height(100) +``` + ## 接口说明 ### ImageKnifeOption参数列表