0

我正在尝试显示存储在附件中的图像。我尝试了以下组合,但似乎没有任何效果:

<img src="'servlet/servlet.FileDownload?file='{productItem.product.attachmentId}"/>
<img src="/servlet/servlet.FileDownload?file={productItem.product.attachmentId}"/>
<img src=\{imageDownload}{productItem.product.attachmentId}/> <!--(imageDownload = '/servlet/servlet.FileDownload?file=';)-->
<img src="'https://ccdev3-abinbev-ei-crm.cs105.force.com/MyABIB2BCommunity/servlet/servlet.FileDownload?file='+{productItem.product.attachmentId}"/>
<img src="'https://ccdev3-abinbev-ei-crm.cs105.force.com/MyABIB2BCommunity/servlet/servlet.FileDownload?file='{productItem.product.attachmentId}"/>
<img src="https://ccdev3-abinbev-ei-crm.cs105.force.com/MyABIB2BCommunity/servlet/servlet.FileDownload?file={productItem.product.attachmentId}"/>```

输出:
https://i.stack.imgur.com/6q8kt.png
4

1 回答 1

0

我已设法通过将包装器从 Id 更改为具有硬编码值的字符串来解决此问题:基本上我的包装器现在看起来像 attachmentId:“https://ccdev3-abinbev-ei-crm.cs105.force.com/MyABIB2BCommunity /servlet/servlet.FileDownload?file=00P1w000003eSStEAM"

在 LWC HTML 中,我简单地使用:

于 2020-06-25T10:22:52.690 回答