ImageKnife提供图片加载成功失败的事件README补充
Signed-off-by: 任伟x <renwei79@h-partners.com>
This commit is contained in:
parent
2b5d0d3f0c
commit
27094f0db9
23
README.md
23
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参数列表
|
||||
|
|
Loading…
Reference in New Issue