为什么网格项目材料UI V5无法正常工作?
我遇到了MUI V5的网格组件的问题。如果在沙箱中写代码 - 它是有效的问题。我发现我必须给出sx = {{'& .muigrid-root':{flexgrow:'1'}到我的网格容器。但是我的物品属性仍然无法使用。知道我错过了什么吗?
<Paper sx={{ padding: 5, height: '100%' }} >
<Grid container spacing={4} sx={{border:'1px solid red','& .MuiGrid-root':{flexGrow: '1'},}}>
<Grid item item xs={12} sm={12} md={12} lg={6} xl={4} sx={{border:'1px solid blue',}}> grid 1</Grid>
<Grid item xs={2} sx={{border:'1px solid blue',}}> grid 2</Grid>
<Grid item xs={6} sx={{border:'1px solid blue',}}> grid 3</Grid>
</Grid>
</Paper>
结果让我失望 result
版本如果mui:“@mui/yater
I faced with a problem with usage of Grid component from MUI V5. The problem that if write code in sandbox - it's works. I find out that i have to give sx={{'& .MuiGrid-root': { flexGrow: '1' } to my Grid container. But still my items property of xs doesn't works. Any idea what i missed?
<Paper sx={{ padding: 5, height: '100%' }} >
<Grid container spacing={4} sx={{border:'1px solid red','& .MuiGrid-root':{flexGrow: '1'},}}>
<Grid item item xs={12} sm={12} md={12} lg={6} xl={4} sx={{border:'1px solid blue',}}> grid 1</Grid>
<Grid item xs={2} sx={{border:'1px solid blue',}}> grid 2</Grid>
<Grid item xs={6} sx={{border:'1px solid blue',}}> grid 3</Grid>
</Grid>
</Paper>
And the result just disappointment me
result
Version if MUI : "@mui/material": "^5.8.2",
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论