let w = Math.tan(Math.PI/len)*width/2+"px";
//得到邻边长度,border-top-width为半径,用邻边设置透明生成三角形
return startList.map((el,ind)=>{
return <li className={"li"+(ind%2==0? "1":"2")} style={{transform:`rotate(${ind*r}turn)`}} key={ind}>
<img src="" width="20" height="20" />
<p className="bg" style={{borderLeftWidth:w,borderRightWidth:w}} ></p>
<p>{el.Name}</p>
</li>
})
复制代码
css3 实现扇形组圆
最新推荐文章于 2024-03-27 21:00:11 发布