IPropertyPaneAccessor interface
Web 部件上下文属性窗格访问器接口。 提供一些最常用的操作来访问属性窗格和内容面板。
方法
| close() | 此 API 应用于关闭 PropertyPane 或内容面板,以帮助配置 Web 部件。 |
| is |
如果 ContentPanel 处于打开状态,则返回 true。 |
| is |
如果 PropertyPane 处于打开状态,则返回 true。 |
| is |
如果内容面板处于打开状态,并且内容面板中支持指定的 instanceId,则返回 true。 如果属性面板处于打开状态,并且属性窗格中支持指定的 instanceId,则返回 true。 |
| is |
指示 Web 部件最初是否打开了 PropertyPane/内容面板。 |
| open() | 此 API 应用于打开 PropertyPane 或内容面板,以帮助配置 Web 部件。 |
| open |
此 API 应用于打开详细信息属性窗格/内容面板,以帮助配置 Web 部件中的项。 |
| refresh() | 此 API 应用于调用 PropertyPane 或内容面板,以帮助配置 Web 部件。 |
方法详细信息
close()
此 API 应用于关闭 PropertyPane 或内容面板,以帮助配置 Web 部件。
close(): void;
返回
void
isContentPanelOpen()
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
如果 ContentPanel 处于打开状态,则返回 true。
isContentPanelOpen(): boolean;
返回
boolean
注解
如果内容面板处于打开状态,则返回 true,而不管内容面板是否呈现属性窗格。
isPropertyPaneOpen()
如果 PropertyPane 处于打开状态,则返回 true。
isPropertyPaneOpen(): boolean;
返回
boolean
注解
每当属性窗格处于打开状态时,无论它是托管在内容面板还是传统属性窗格 UI 中,都是如此。
isPropertyPaneOpen(instanceId)
注意
此 API 以预览状态提供给开发者,可能根据我们收到的反馈更改。 请勿在生产环境中使用此 API。
如果内容面板处于打开状态,并且内容面板中支持指定的 instanceId,则返回 true。 如果属性面板处于打开状态,并且属性窗格中支持指定的 instanceId,则返回 true。
isPropertyPaneOpen(instanceId?: string): boolean;
参数
- instanceId
-
string
返回
boolean
isRenderedByWebPart()
指示 Web 部件最初是否打开了 PropertyPane/内容面板。
isRenderedByWebPart(): boolean;
返回
boolean
注解
例如,如果 Web 部件调用 this.context.propertyPane.open () 则该属性为 true,而如果主机打开了配置,则值将为 false。
open()
此 API 应用于打开 PropertyPane 或内容面板,以帮助配置 Web 部件。
open(): void;
返回
void
openDetails(context)
此 API 应用于打开详细信息属性窗格/内容面板,以帮助配置 Web 部件中的项。
openDetails(context?: any): void;
参数
- context
-
any
为属性窗格或内容面板添加其他上下文
返回
void
注解
此 API 主要用于配置详细信息,这与配置 Web 部件本身不同。
refresh()
此 API 应用于调用 PropertyPane 或内容面板,以帮助配置 Web 部件。
refresh(): void;
返回
void
注解
仅当 PropertyPane 已为当前活动 Web 部件打开时,此操作才有效。 如果为另一个 Web 部件打开了 PropertyPane,则调用刷新 API 将不起作用。