attached() {
const dpr = wx.getSystemInfoSync().pixelRatio
const query = wx.createSelectorQuery().in(this)
this.dpr = dpr
query.select('#canvas')
.fields({node: true, size: true})
.exec(res => {
console.log(res,",,,,,,,,,,,,,,,,,,");
const canvas = res[0].node
const ctx = canvas.getContext('2d')
canvas.width = res[0].width * dpr
canvas.height = res[0].height * dpr
ctx.scale(dpr, dpr)
this.ctx = ctx
this.canvas = canvas
})
}
https://developers.weixin.qq.com/s/SHfgCmmq7UcM
你好,是只有真机调试有问题么?预览和真机上测试是否正常?请提供能复现问题的简单代码片段https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html