【发布时间】:2020-01-18 01:45:40
【问题描述】:
我正在尝试使用附件模块,特别是这些功能: https://pnp.github.io/pnpjs/sp/attachments/ 我已经安装了所有必要的 pnp/sp 模块(我认为!)使用:https://pnp.github.io/pnpjs/getting-started/ 作为参考。 问题是我得到附件模块的“找不到模块”。以下是导入:
import { default as pnp } from 'sp-pnp-js';
import { ItemAddResult, Web } from 'sp-pnp-js';
import { sp } from "@pnp/sp"; //this is fine, which suggests it's installed properly?
import { IItem } from '@pnp/sp/attachments'; //cannot find this module
import "@pnp/sp/webs";
import "@pnp/sp/lists/web";
import "@pnp/sp/items";
import "@pnp/sp/attachments";
我已经在这个特定项目中成功使用了 pnp.sp 功能,所以我很困惑为什么我不能导入和使用附件功能。
【问题讨论】: