CanvasRenderingContext2D.prototype.clear = function() {
....
}
时遇到该问题,但我看通过以下代码:
const query = wx.createSelectorQuery()
query.select('#myCanvas')
.fields({
node: true,
size: true
})
.exec((res) => {
const canvas = res[0].node
this.canvas = canvas;
const ctx = canvas.getContext('2d')
...
}
获取到的ctx 对象就是CanvasRenderingContext2D类型的?
基础库:2.15.0