111
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<cite>
|
||||
**本文档引用文件**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts)
|
||||
- [WindowFormService.ts](file://src/services/WindowFormService.ts)
|
||||
</cite>
|
||||
|
||||
## 目录
|
||||
@@ -16,11 +16,11 @@
|
||||
|
||||
`windowFormCreated` 事件在新窗口实例成功挂载并完成首次渲染后触发,标志着窗口已完全初始化并可交互。该事件不携带任何参数,作为全局窗口创建完成的信号。
|
||||
|
||||
根据 `WindowFormEventManager.ts` 中的定义,此事件是 `IWindowFormEvent` 接口的一部分,由 `wfem` 事件管理器负责分发。虽然当前实现中未直接显示触发逻辑,但结合 `WindowService.ts` 的窗口创建流程可知,该事件应在 `createWindow` 方法执行完毕、DOM 元素已添加至页面且应用内容加载完成后被通知。
|
||||
根据 `WindowFormEventManager.ts` 中的定义,此事件是 `IWindowFormEvent` 接口的一部分,由 `wfem` 事件管理器负责分发。虽然当前实现中未直接显示触发逻辑,但结合 `WindowFormService.ts` 的窗口创建流程可知,该事件应在 `createWindow` 方法执行完毕、DOM 元素已添加至页面且应用内容加载完成后被通知。
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L41-L41)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
|
||||
## 应用场景分析
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L41-L41)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
|
||||
## 事件监听代码范例
|
||||
|
||||
@@ -58,7 +58,7 @@ wfem.addEventListener('windowFormCreated', () => {
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L60-L60)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
|
||||
## 生命周期时序关系
|
||||
|
||||
@@ -73,4 +73,4 @@ wfem.addEventListener('windowFormCreated', () => {
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L41-L41)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L83-L118)
|
||||
@@ -3,7 +3,7 @@
|
||||
<cite>
|
||||
**本文档引用文件**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts)
|
||||
- [WindowFormService.ts](file://src/services/WindowFormService.ts)
|
||||
- [WindowFormTypes.ts](file://src/ui/types/WindowFormTypes.ts)
|
||||
</cite>
|
||||
|
||||
@@ -73,14 +73,14 @@ I --> J[接收端更新UI]
|
||||
```
|
||||
|
||||
**Diagram sources**
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
|
||||
**Section sources**
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L512-L552)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L248-L304)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L179-L213)
|
||||
|
||||
## 接收端批量更新UI的TypeScript示例
|
||||
接收 `windowFormDataUpdate` 事件后,应使用接收到的完整数据对象一次性批量更新UI,避免逐个属性设置带来的性能开销和视觉闪烁。以下为推荐的处理方式:
|
||||
@@ -146,4 +146,4 @@ wfem.addEventListener('windowFormDataUpdate', debouncedHandler);
|
||||
|
||||
**Section sources**
|
||||
- [WindowFormEventManager.ts](file://src/events/WindowFormEventManager.ts#L37-L37)
|
||||
- [WindowService.ts](file://src/services/WindowService.ts#L67-L118)
|
||||
- [WindowFormService.ts](file://src/services/WindowService.ts#L67-L118)
|
||||
Reference in New Issue
Block a user