再开发工具上可以运行,没错误信息,再真机调试就报错误了
js
const query = wx.createSelectorQuery()
wx.showLoading({
title: '海报生成中'
})
var res = query.select('#haibao')
console.log(res)
res = res.fields({ node: true, size: true })
console.logres)
res.exec(functionres) { //这步报错了
console.log(res)
}
wxml
<canvas style"width:100%;height:100px;"type="2d" id="haibao" canvas-id="haibao"></canvas>
错误信息
canvas 2d 真机会报这个错误
建议你换回就的api 2d各种不谦容