- pc端打开小程序,图片裁剪功能报错
let context = canvas.getContext("2d"); let image = canvas.createImage(); await new Promise((resolve, reject) => { image.onload = resolve; image.onerror = reject; image.src = this.url; }); //canvas 小程序端用电脑从微信打开小程序(电脑系统为Lwin11,MacOS )image 监听不到load事件,context.drawImage(image, mx.sx, mx.sy, mx.sw, mx.sh, mx.dx, mx.dy, mx.dw, mx.dh); 会报错 错误提示 [Component] <canvas>: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0. Error: Failed to execute 'drawImage' on 'CanvasRenderingContext2D': The image argument is a canvas element with a width or height of 0. at l.<anonymous> (9c614b8d0c61e710871cb03a5c1c016f-9115-V0FXZWJ2aWV3Lmpz.cachedata:1:1333197) at Generator.next (<anonymous>) at n (9c614b8d0c61e710871cb03a5c1c016f-9115-V0FXZWJ2aWV3Lmpz.cachedata:1:4032) at s (9c614b8d0c61e710871cb03a5c1c016f-9115-V0FXZWJ2aWV3Lmpz.cachedata:1:4235)
05-09 - 体验版选择手术部位和手术功能是好的,上架后正式版手术数据不渲染
[图片] 代码 [图片] //发送监听数据 let params={ index:this.index, checkedList:this.checkedList } uni.$emit('surgical', params)
2023-08-23