小程序webview里canvas加载Image安卓真机有兼容问题?
安卓真机有几款机型直接走onerror,IOS真机和开发者工具正常,是兼容问题吗?
//JS加载图片类,
const loadImage = (canvas,src) => {
return new Promise((ok,fail) => {
let interval = null;
let seal = new Image();
// let seal = canvas.createImage();
seal.setAttribute("crossOrigin",'anonymous');
seal.onload = (res) => {
// alert('in loading图片加载完成:' + src);
ok(seal)
}
seal.onerror = err => {
ok(false)
}
seal.src = src;
})
}
1 回复
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)