有没有办法将网格项目限制为每行 2 个并使每行中的项目占用所有可用空间?我正在使用 ReactJS 和 MaterialUI 核心。
这是主网格:
<Grid
container
direction="row"
alignContent="center"
alignItems="center"
wrap="wrap"
>
<Grid item className={classes.cardDesign}>
{showTags ? <Tags /> : null}
</Grid>
<Grid item className={classes.cardDesign}>
{showReactions ? <Reactions /> : null}
</Grid>
<Grid item className={classes.cardDesign}>
{showEmojiStats ? <EmojiStats /> : null}
</Grid>
<Grid item className={classes.cardDesign}>
{showFilter ? <Filter /> : null}
</Grid>
</Grid>
这些是网格项目:
<div className={classes.root}>
<Card className={classes.cardDesign}>
<CardContent>
<Typography
className={classes.title}
color="textSecondary"
gutterBottom
>
Filters
</Typography>
<Typography variant="h5" component="h2">
be{bull}nev{bull}o{bull}lent
</Typography>
<Typography className={classes.pos} color="textSecondary">
adjective
</Typography>
<Typography variant="body2" component="p">
well meaning and kindly.
<br />
{'"a benevolent smile"'}
</Typography>
</CardContent>
<CardActions>
<Button size="small">Learn More</Button>
</CardActions>
</Card>
</div>