我得到了以下 Paper 元素,其中包含一些复选框:
我希望它们垂直堆叠,但我不太清楚如何。我的 Paper 元素位于网格项中:
<Grid item xs={1} spacing={4}>
<Paper className={classes.paper}>
<Typography>(currently empty)</Typography>
{this.getBoxesWithLabels(this.getLevelLabels(4, -3))}
</Paper>
</Grid>
因此它在用户界面上不会有太多空间(这是预期的)。我该怎么办呢?我尝试过使用 justifyContent、justifySelf、alignItems 等,但它没有改变任何内容。
最佳答案
试试这个:
<Grid item xs={1} spacing={4}>
<Paper className={classes.paper}>
<Grid direction="column">
<Typography>(currently empty)</Typography>
{this.getBoxesWithLabels(this.getLevelLabels(4, -3))}
</Grid>
</Paper>
</Grid>
关于javascript - 在网格中垂直堆叠控件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54073633/