我是Purescript的新手,所以我不知道如何在一个div中显示多个SVG。 我研究了一些代码示例,并实现了此代码库,但存在问题。 此代码有什么问题?
renderView :: State -> H.ComponentHTML Query
renderView state = let
{vertices, edges} = state.shape
{currentId, shapes} = state.shapeCnt
vert2Ds = map project vertices
in
HH.div_
[
HH.div [] $
[ renderButton "rotX++" (IncAngVelocity X)
, renderButton "rotY++" (IncAngVelocity Y)
, renderButton "rotZ++" (IncAngVelocity Z)
, renderButton "Add Cube" (AddCube)
, renderButton "Remove Cube" (RemoveCube)
],
HH.div_ $ flip map shapes \sid ->
Tuple (show sid) $
[ SE.svg
[ SA.viewBox 0.0 0.0 viewBoxSize viewBoxSize ]
[ SE.g []
(drawCube edges vert2Ds)
]
]
]