涂鸦小程序官方Canvas库启动了,欢迎提需求了 🎉🎉🎉

面板小程序开发相关产品技术讨论,包括面板小程序、智能小程序、React Native、Ray跨端框架、Panel SDK、微信小程序、小程序开发工具(IDE)及其他开发技术相关等话题


wink_li
Posts: 11

crisiron 2024年 Apr 25日 10:51

<canvas style={{width: '200px', height: '200px'}} canvas-id="pageCanvas1"></canvas> 这个加上 type='2d'
类似
<canvas class='ray_canvas' canvas-id='canvasId' disable-scroll="true" type='2d'></canvas>

添加type报错了

Type '{ style: { width: string; height: string; }; "canvas-id": string; type: string; }' is not assignable to type 'DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>'.
Property 'type' does not exist on type 'DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>'

crisiron
Posts: 47

Re: 涂鸦小程序官方Canvas库启动了,欢迎提需求了 🎉🎉🎉

wink_li 2024年 Apr 25日 11:16
crisiron 2024年 Apr 25日 10:51

<canvas style={{width: '200px', height: '200px'}} canvas-id="pageCanvas1"></canvas> 这个加上 type='2d'
类似
<canvas class='ray_canvas' canvas-id='canvasId' disable-scroll="true" type='2d'></canvas>

添加type报错了

Type '{ style: { width: string; height: string; }; "canvas-id": string; type: string; }' is not assignable to type 'DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>'.
Property 'type' does not exist on type 'DetailedHTMLProps<CanvasHTMLAttributes<HTMLCanvasElement>, HTMLCanvasElement>'

这种方式用法不支持 createConicGradient, createConicGradient 同时存在兼容性问题,很多较低版本的手机系统不支持, 我们在月底开放的库中有封装对应的方法来兼容

wink_li
Posts: 11

Re: 涂鸦小程序官方Canvas库启动了,欢迎提需求了 🎉🎉🎉

好吧,期待新库 :D

Post Reply