Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 反应物料界面网格列表行/列问题_Reactjs_Grid_Material Ui - Fatal编程技术网

Reactjs 反应物料界面网格列表行/列问题

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

我正在尝试使用材质UI将图像显示到网格列表中。不幸的是,它在一些图像之间产生了一个间隙(红方块),如下所示:

下面是我的代码的样子:

      <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