This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
WorkerPortal 类接口 用于管理组件的生命周期和事件处理
interface ISYS_ReactComponentizationDialogWorkerPortal WorkerPortal 负责在虚拟环境中创建、更新和销毁组件, 并通过消息机制与 EditorDesignPortal 通信。
|
Property |
Modifiers |
Type |
Description |
|---|---|---|---|
|
(handle: string, callback: (event: unknown) => void) => void |
(ALPHA) 绑定事件处理器 | ||
|
(handle: string, type: string, props: Record<string, unknown>, parent: string) => void |
(ALPHA) 创建组件 | ||
|
(handle: string) => void |
(ALPHA) 销毁组件 | ||
|
(handle: string, event: unknown) => void |
(ALPHA) 触发事件 | ||
|
React.ComponentType<React.PropsWithChildren<unknown>> |
(ALPHA) Provider 组件 用于提供 PortalContext 给子组件 | ||
|
(handle: string, props: Record<string, unknown>) => void |
(ALPHA) 更新组件 |
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
绑定事件处理器
bindEvent: (handle: string, callback: (event: unknown) => void) => void;This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
创建组件
createComponent: (handle: string, type: string, props: Record<string, unknown>, parent: string) => void;This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
销毁组件
detachComponent: (handle: string) => void;This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
触发事件
dispatchEvent: (handle: string, event: unknown) => void;This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Provider 组件 用于提供 PortalContext 给子组件
Provider: React.ComponentType<React.PropsWithChildren<unknown>>;This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
更新组件
updateComponent: (handle: string, props: Record<string, unknown>) => void;