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参数列表