使用spfx在SharePoint web部件中显示SP项附件
我正在开发一个SharePoint web部件,它基本上是一个连接到SPO列表的表单。在表单中,我考虑使用一个附件字段让用户附加word或pdf文档。代码中是否有任何内容可供我在表单中显示此附件的内容,或以某种方式打印出文档的内容而无需打开文档?您可以通过在文档的URL中添加文本来使用SharePoint Online Office Web App使用spfx在SharePoint web部件中显示SP项附件,sharepoint,sharepoint-online,spfx,Sharepoint,Sharepoint Online,Spfx,我正在开发一个SharePoint web部件,它基本上是一个连接到SPO列表的表单。在表单中,我考虑使用一个附件字段让用户附加word或pdf文档。代码中是否有任何内容可供我在表单中显示此附件的内容,或以某种方式打印出文档的内容而无需打开文档?您可以通过在文档的URL中添加文本来使用SharePoint Online Office Web App https://yourDomain/sites/yourSite/Lists/Tasks/Attachments/1/AdventureWorks
https://yourDomain/sites/yourSite/Lists/Tasks/Attachments/1/AdventureWorksBikes.xlsx?web=1
或者通过使用文档查看器页面的直接路径:
https://yourDomain/sites/yourSite/sites/yourSite/_layouts/15/Doc.aspx?sourcedoc=/sites/yourSite/Lists/Tasks/Attachments/1/AdventureWorksBikes.xlsx&action=default&mobileredirect=true
如果您想在现有页面中显示上述内容,可以将其放在IFRAME中