2.11.3 开发工具版本1.03.2006090 开发预览都没问题就是真机调试 出错 导致页面加载不出来。审核过不去。体验版完全没问题。
<canvas canvas-id="11" type="2d" id ="myCanvas" style='width:{{canvasWidth}}px; height:{{canvasHeight}}px'
bindtouchstart='touchStart' bindtouchmove='touchMove' bindtouchend='touchEnd'
disable-scroll='true'
force-use-old-canvas="true"
></canvas>
wx.createSelectorQuery()
.select('#myCanvas')
.fields({
node: true,
size: true,
})
.exec(this.init.bind(this))
init(res){
const that = this
const width = res[0].width
const height = res[0].height
const canvas = res[0].node
const ctx = canvas.getContext('2d')
const dpr = wx.getSystemInfoSync().pixelRatio
canvas.width = width * dpr
canvas.height = height * dpr
ctx.scale(dpr, dpr)
const renderLoop = () => {
this.render(canvas, ctx)
canvas.requestAnimationFrame(renderLoop)
}
canvas.requestAnimationFrame(renderLoop)
},
你好,新的 canvas 接口暂未支持真机调试,可以先直接用预览或直接在开发者工具上调试。
就是审核总说我主页加载不了