GridListTile /惰性图像加载/非垂直输入图像

时间:2019-09-13 07:48:56

标签: material-ui

当缩小到正方形视图时,Gridlist将自动对图像进行居中和裁剪。仅图像标签支持此功能。

<GridListTile key={tile.img}>
   <img src={tile.img} alt={tile.title} />
</GridListTile>

如何用React Lazy Load Image Component替换此图片而又不失去这种行为:

<GridListTile key={tile.img}>
   <LazyLoadImage
      alt={image.alt}
      height={image.height}
      src={image.src} // use normal <img> attributes as props
      width={image.width} />
</GridListTile>

0 个答案:

没有答案