!287 ImageKnife提供图片加载成功/失败的事件README补充
Merge pull request !287 from 任伟x/master
This commit is contained in:
commit
f7bb2f1999
17
README.md
17
README.md
|
@ -144,6 +144,23 @@ async function custom(context: Context, src: string): Promise<ArrayBuffer | unde
|
||||||
ImageKnifeGlobal.getInstance().getImageKnife()?.replaceDataFetch(new CustomDataFetchClient());
|
ImageKnifeGlobal.getInstance().getImageKnife()?.replaceDataFetch(new CustomDataFetchClient());
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 8.监听图片加载成功与失败
|
||||||
|
```
|
||||||
|
ImageKnifeNextComponent({
|
||||||
|
imageKnifeNextOption: {
|
||||||
|
loadSrc: 'http://e.hiphotos.baidu.com/image/pic/item/4e4a20a4462309f7e41f5cfe760e0cf3d6cad6ee.jpg',
|
||||||
|
onLoadListener: {
|
||||||
|
console.log('Load Successful: ' + data);
|
||||||
|
return data;
|
||||||
|
},
|
||||||
|
onLoadFailed: (err) => {
|
||||||
|
console.error('Load Failed Reason: ' + err);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}).width(100).height(100)
|
||||||
|
```
|
||||||
|
|
||||||
## 进阶使用
|
## 进阶使用
|
||||||
|
|
||||||
如果简单的加载一张图像无法满足需求,我们可以看看ImageKnifeOption这个类提供了哪些扩展能力。
|
如果简单的加载一张图像无法满足需求,我们可以看看ImageKnifeOption这个类提供了哪些扩展能力。
|
||||||
|
|
Loading…
Reference in New Issue