我希望實(shí)現(xiàn)盡可能少的代碼,因此我在我的應(yīng)用程序中實(shí)現(xiàn)了一個(gè)可重用的組件。我的問題是如何迭代Grid,Card和中的列和行Table。對此最好的解決方案是什么?預(yù)期輸出代碼? <Grid container spacing={2}>? ? {rows.map((row, index) => (? ? ? <Grid item md={4} sm={6} xs={12} key={index}>? ? ? ? <CardComponent columns={columns} rows={row} />? ? ? </Grid>? ? ))}? </Grid>
在 React 中迭代網(wǎng)格和卡片中的值
眼眸繁星
2023-07-20 10:11:19