本文介绍了在SpFx WebPart中读取JSON文件(客户端)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Json文件,即MyCustom.json里面的"Site Assets" sharepoint的文件夹。

I have one Json file namely MyCustom.json inside "Site Assets" folder of sharepoint.

现在我创建了一个SpFx WebPart(客户端WebPart),尝试在同一个webpart中读取Json文件(MyCustom.json)。

Now I ve created one SpFx WebPart (client-side WebPart), trying to read the Json file (MyCustom.json) inside the same webpart.

任何人都可以请帮助...

can anyone please help in the same..

谢谢,

Balaram

推荐答案

http:// site url / _api / web / GetFolderByServerRelativeUrl('/ Folder Name')/ Files('file name')/

http://site url/_api/web/GetFolderByServerRelativeUrl('/Folder Name')/Files('file name')/


在这里,您可以找到如何使用SPFx中的REST API的示例:
SharePoint Framework:如何使用ReactJs和Type在SPFx客户端Web部件中显示文档库数据脚本


Here you may find example how to use REST API from SPFx: SharePoint Framework: how to display document library data in a SPFx client side web part using ReactJs and Type Script


这篇关于在SpFx WebPart中读取JSON文件(客户端)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 07:47
查看更多