Page 2 of 2

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

Posted: 2024年 Apr 25日 11:16
by wink_li
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>'


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

Posted: 2024年 Apr 25日 15:58
by crisiron
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 同时存在兼容性问题,很多较低版本的手机系统不支持, 我们在月底开放的库中有封装对应的方法来兼容


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

Posted: 2024年 Apr 25日 18:24
by wink_li

好吧,期待新库 :D