选择器选择 canvas 后执行exec 报错这是什么情况?
再开发工具上可以运行,没错误信息,再真机调试就报错误了
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>
错误信息