[LayaAir 2.0]2.0.2使用worker加载图片的问题
Laya.loader.load加载图片时,如果使用worker加载,会调用到loadImage方法,然后执行这句话`this.worker.postMessage(url);`,然后
在worker.js中执行了这句话`onmessage=function(t){var e=t.data;switch(e.type){case"load":loadImage2(e)}};`,e=t.data,也就是上面postMessage中的url,是一个字符串,那么e.type是undefined,根本不会执行到loadImage2(e)。
在worker.js中执行了这句话`onmessage=function(t){var e=t.data;switch(e.type){case"load":loadImage2(e)}};`,e=t.data,也就是上面postMessage中的url,是一个字符串,那么e.type是undefined,根本不会执行到loadImage2(e)。
没有找到相关结果
已邀请:
1 个回复
Aar0n
赞同来自: