Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用共享点框架“无 JavaScript 框架”创建 Web 部件 我的代码使用 TypeScript 我有问题,我会得到或读取数据分类术语存储共享点。
我的代码在图像中
问题:如何在我的代码中声明变量“SP”?因为我的代码错误要求变量“SP”首先声明
SP 是 sp.js 的一部分,但是当您使用 SPFX WebPart 时,您应该改用 TypeScript,请查看演示以阅读 SPFX Webpart 中的分类:
分类 Web 部件
此文件显示使用 TypeScript 从 Term Store 获取 Term:
sp-dev-fx-webparts/samples/knockout-taxonomy/src/webparts/termSetRequester/data-helpers/DataHelperSP.ts