// 申明一个类型别名
type Circle ={
x: number
y: number
r: number
sAngle: number
eAngle: number
color?: string // ?: 表示属性可选}functiondrawCircle({ x, y, r, sAngle, eAngle, color ='red'}: Circle){
ctx.beginPath()
ctx.arc(x, y, r, sAngle, eAngle)// 线宽
ctx.lineWidth =8// 线帽类型
ctx.lineCap ='round'// 颜色样式
ctx.strokeStyle = color
ctx.stroke()}
我看了好久这个typycropt,以为又出了什么新语言了
哈哈,打错了,英语不好
现成的canvas画布组件太多,自己使用canvas画图 还没尝试过,有时间可琢磨下原理 自己画一个~mark
666
不错,听说 react 比 vue 灵活,找时间学学
在大佬面前献丑了
大佬谦虚了
666