使用SPFX Web部件显示图像库中的图像

问题描述

我正在尝试使用SPFX制作display Image WP。图像放置在图像库中。我在引用图像时遇到问题...我在做什么错?谢谢...

export interface ISPList{
  Title: string;
  Image: ????;

解决方法

SharePoint图片列包含一个Url值和一个Description值。您只需要在item中获取Url值并将其设置为src属性即可。

SharePoint Online在现代页面中具有默认的图像Web部件。 enter image description here