SharePoint 框架扩展概述Overview of SharePoint Framework Extensions

可以使用 SharePoint 框架 (SPFx) 扩展来扩展 SharePoint 用户体验。You can use SharePoint Framework (SPFx) Extensions to extend the SharePoint user experience. 使用 SharePoint 框架扩展,可以自定义 SharePoint 体验的更多方面,包括通知区域、工具栏和列表数据视图。With SharePoint Framework Extensions, you can customize more facets of the SharePoint experience, including notification areas, toolbars, and list data views. 所有 Office 365 订阅中都有 SharePoint 框架扩展可用于生产。SharePoint Framework Extensions are available in all Office 365 subscriptions for production usage.


可以在加入 Office 365 开发人员计划时,获取 Office 365 开发人员订阅。You can get an Office 365 developer subscription when you join the Office 365 Developer Program. 请参阅 Office 365 开发人员计划文档,逐步了解如何加入 Office 365 开发人员计划并注册和配置订阅。See the Office 365 Developer Program documentation for step-by-step instructions about how to join the Office 365 Developer Program and sign up and configure your subscription.

借助 SharePoint Framework 扩展,能够在新式页面和文档库中扩展 SharePoint 用户体验,同时使用熟悉的 SharePoint Framework 工具和库来进行客户端开发。具体来说,SharePoint Framework 包括以下三个新的扩展类型:SharePoint Framework Extensions enable you to extend the SharePoint user experience within modern pages and document libraries, while using the familiar SharePoint Framework tools and libraries for client-side development. Specifically, the SharePoint Framework includes three new extension types:

  • 应用自定义工具Application Customizers. 将脚本添加到页面,访问众所周知的 HTML 元素占位符,并使用自定义呈现来扩展它们。Adds scripts to the page, and accesses well-known HTML element placeholders and extends them with custom renderings.
  • 字段自定义工具Field Customizers. 为列表中的字段数据提供修改后的视图。Provides modified views to data for fields within a list.
  • 命令集Command Sets. 扩展 SharePoint 命令图面以添加新操作,并提供可用于实现行为的客户端代码。Extends the SharePoint command surfaces to add new actions, and provides client-side code that you can use to implement behaviors.

除了纯 JavaScript 项目外,还可以在常见脚本框架(如 AngularJS 和 React)中生成扩展。例如,可以将 React 与 Office UI Fabric React 的组件结合使用,以基于 Office 365 中所使用的相同组件创建体验。You can build extensions alongside common scripting frameworks, such as AngularJS and React, in addition to plain JavaScript projects. For example, you can use React along with components from Office UI Fabric React to create experiences based on the same components used in Office 365.

开始使用Get started

  1. 如果尚未安装 SharePoint Framework,请遵循相关步骤来设置开发环境If you haven't installed the SharePoint Framework, follow the steps to Set up your development environment.

  2. 安装 SharePoint Framework 后,请运行下面的命令将 Yeoman 模板更新到最新版本:After you install the SharePoint Framework, run the following command to update your Yeoman templates with the latest version:

    npm install -g @microsoft/generator-sharepoint
  3. 然后,可以生成首个 SharePoint Framework 扩展(Hello World 第 1 部分)Next, you can Build your first SharePoint Framework Extension (Hello World part 1).

保持最新状态Stay up to date

若要了解对 SharePoint Framework 的改进(包括扩展更新),请参阅以下内容:To keep track of improvements to the SharePoint Framework, including updates to extensions, see the following:

提供反馈Provide feedback

我们邀请你就 SharePoint 框架通用版本提供反馈意见。We invite you to give us your feedback on the SharePoint Framework General Availability release. 你可以使用以下资源直接向 SharePoint 工程团队提供反馈:You can use the following resources to provide feedback directly to the SharePoint engineering team:

另请参阅See also