forked from floraachy/ImageKnife
1.当loadSrc参数传入为undefined时,结束gif循环和原有的canvas数据内容
Signed-off-by: zhoulisheng1 <zhoulisheng1@huawei.com>
This commit is contained in:
parent
065abc6686
commit
d77539c555
|
@ -252,10 +252,14 @@ export struct ImageKnifeComponent {
|
|||
// imageknife 第一次启动和数据刷新后重新发送请求
|
||||
imageKnifeExecute() {
|
||||
if (this.imageKnifeOption.loadSrc == null) {
|
||||
// 如果数据是null或者undefined 则不进入图片请求流程
|
||||
// 如果数据是null或者undefined,清空图片内容和gif循环,并且不进入图片请求流程
|
||||
this.resetGifData()
|
||||
if (this.canvasHasReady) {
|
||||
// 如果canvas已经初始化好了,清空原有的canvas内容
|
||||
this.context.clearRect(0, 0, this.currentWidth, this.currentHeight)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
this.resetGifData()
|
||||
let request = new RequestOption();
|
||||
this.configNecessary(request);
|
||||
|
|
Loading…
Reference in New Issue