https://developers.weixin.qq.com/miniprogram/dev/framework/client-lib/https://developers.weixin.qq.com/miniprogram/dev/api/file/FileSystemManager.writeFile.html
使用3.3.7版本Taro框架,开发工具上3.7.9基础库时,使用Canvas绘图白屏,其他版本(比如3.7.8、3.7.7等)基础库经测试均显示正常。
真机上最新版本微信APP中打开小程序Canvas绘制页面也会出现白屏或者黑屏的情况。还请官方帮看下。谢谢。
const ctx = Taro.createCanvasContext('myCanvas', this);
ctx.beginPath()
ctx.arc(220, 410, 60 / 2, 0, 2 * Math.PI);
ctx.clip();
ctx.setFillStyle('green');
ctx.fill();
ctx.draw(true);
const ctx = Taro.createCanvasContext('myCanvas', this);删掉this参数试试
这个接口不维护了,使用 Taro.createSelectorQuery()获取画布对象
https://taro-docs.jd.com/docs/apis/wxml/createSelectorQuery#%E7%B1%BB%E5%9E%8B
https://developers.weixin.qq.com/miniprogram/dev/framework/ability/canvas-legacy-migration.html
可能是旧版画布接口不维护了导致的,可以切到新版接口试试
https://developers.weixin.qq.com/miniprogram/dev/framework/ability/canvas-legacy-migration.html