Reactjs 反应物料界面网格列表行/列问题
我正在尝试使用材质UI将图像显示到网格列表中。不幸的是,它在一些图像之间产生了一个间隙(红方块),如下所示: 下面是我的代码的样子:Reactjs 反应物料界面网格列表行/列问题,reactjs,grid,material-ui,Reactjs,Grid,Material Ui,我正在尝试使用材质UI将图像显示到网格列表中。不幸的是,它在一些图像之间产生了一个间隙(红方块),如下所示: 下面是我的代码的样子: <GridList className="gridList" cols={3}> {this.state.images.map((tile, index) => ( <GridListTile rows={index === 0 ? 2 : 1} cols={index
<GridList className="gridList" cols={3}>
{this.state.images.map((tile, index) => (
<GridListTile rows={index === 0 ? 2 : 1} cols={index === 0 ? 2 : 1}>
<img src={tile.url} alt={tile.title} />
</GridListTile>
))}
</GridList>
{this.state.images.map((平铺,索引)=>(
))}
如果有人能指导我找到正确的解决方案,那就太棒了 TL;DR:将
间距={0}
道具添加到网格列表中
NL;PR:您的代码应该如下所示:
你可以玩其他道具
注:在材料5中,GridList已重命名为ImageList。TL;DR:将
间距={0}
道具添加到网格列表中
NL;PR:您的代码应该如下所示:
你可以玩其他道具
注:在材料5中,GridList已重命名为ImageList