https://developers.weixin.qq.com/miniprogram/en/dev/api/canvas/wx.createOffscreenCanvas.html
Code:
// Create Off Screen 2D canvas Example
const canvas = wx.createOffscreenCanvas({type: '2d', width: 300, height: 150})
// Obtain context。 Note that this must be consistent with the type Agreement
const context = canvas.getContext('2d')
console.log("====");
console.log(context);
Output:
====
[sm]:61 undefined
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。