canvasToTempFilePath:fail:canvasId do not exist" ?
开发者工具调用 没啥反应 真机调试 就报错
canvasId 找不到
用的是 taro 框架
代码
Taro.canvasToTempFilePath({
quality: .8,
fileType: ‘jpg’,
canvasId: ‘mycanvas’,
success: res => {
console.log(‘canvasToTempFilePathsuccess’, res)
this.setState({
tempFilePath: res.tempFilePath
})
},
fail: res => {
console.log(‘canvasToTempFilePathfail’, res)
},
complete: a => {
console.log(‘aaa’, a)
}
}, this)
html
<Canvas style={`width: ${width}px; height: ${height}px;`} className=‘huabu’ canvasId=‘mycanvas’ />
