gpt4 book ai didi

Add flex-grow to material ui Grid(添加弹性-增长到材质用户界面网格)

转载 作者:bug小助手 更新时间:2023-10-25 10:08:07 27 4
gpt4 key购买 nike



Is it possible to add "flex-grow" to a Grid item in material ui? Seams a bit weird that I have to choose Box in order to get access to Flexbox https://material-ui.com/system/flexbox/?

是否可以向材质UI中的网格项目添加“Flex-Growth”?Seams有点奇怪,我必须选择盒子才能访问Flexbox https://material-ui.com/system/flexbox/?


更多回答
优秀答案推荐

Yes, you can add flex-grow using the style attribute.

可以,您可以使用style属性添加flex-Growth。


<Grid item style={{ flexGrow: 1 }}>
<Typography variant="h1" color="textPrimary" >
Title
</Typography>
</Grid>

or you can create a separate class for multiple Grid items.

或者,您可以为多个网格项目创建单独的类。



This is similar to Amir's answer, but uses a styled component:

这与Amir的回答类似,但使用了样式组件:


const StyledGridItem = styled(Grid)({
flexGrow: 1
})

Then implemented...

然后实施了..。


<StyledGridItem item>
// contents of grid item here
</StyledGridItem>

更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com