gpt4 book ai didi

Is there any way to get individual grid size in material ui?(有没有办法在材质用户界面中获得单独的网格大小?)

转载 作者:bug小助手 更新时间:2023-10-25 18:31:33 25 4
gpt4 key购买 nike



I have a component which layout is given below,

我有一个组件,其布局如下所示,


const Faq = () => {
return (
<LandingWrapper>
<CustomContainer>
<CustomStackFullWidth spacing={5}>
<SectionTitle item={staticTexts.landingPageTexts.faq} />
<CustomBoxFullWidth>
<Grid container spacing={3}>
{faqData?.map((item, index) => (
<Grid item xs={12} sm={6} key={index}>
<FaqItem data={item} />
</Grid>
))}
</Grid>
</CustomBoxFullWidth>
</CustomStackFullWidth>
</CustomContainer>
</LandingWrapper>
);
};

Here FaqItem is a component consisting of a question and an answer. The problem is, when I expand the faqitem component, another grid with the item also gets the same height as the expanded grid. As a result, there shows unnecessary space to the grid beside the expanded grid. I want every grid should have only the size of its content. How to set these grid items, their individual content size?

在这里,FaqItem是一个由问题和答案组成的组件。问题是,当我展开faqItem组件时,包含该项的另一个网格的高度也与展开的网格相同。结果,在展开的栅格旁边,栅格显示了不必要的空间。我希望每个网格应该只有其内容的大小。如何设置这些网格项目,它们各自的内容大小?


更多回答
优秀答案推荐
更多回答

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