提交 07eeb4a4 编写于 作者: H hdx

fix(createCanvasContextAsync): setup 应通过 getCurrentInstance()获取

上级 2983b366
...@@ -63,7 +63,7 @@ canvas相关的API非常多,参考如下: ...@@ -63,7 +63,7 @@ canvas相关的API非常多,参考如下:
// 异步调用方式, 跨平台写法 // 异步调用方式, 跨平台写法
uni.createCanvasContextAsync({ uni.createCanvasContextAsync({
id: 'canvas', id: 'canvas',
component: this, component: getCurrentInstance().proxy,
success: (context : CanvasContext) => { success: (context : CanvasContext) => {
const canvasContext = context.getContext('2d')!; const canvasContext = context.getContext('2d')!;
const canvas = canvasContext.canvas; const canvas = canvasContext.canvas;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册