@gct-paas/word 0.2.33-beta.0 → 0.2.33-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -138,7 +138,7 @@ app.mount('#app');
138
138
  - `triggerHandler?`:触发主工程交互(可选)
139
139
  - `plugins?`:要安装的 suite 插件列表(如 `edhrSuitePlugin`)
140
140
 
141
- ### `setupVueRuntime({ app })`
141
+ ### `setupVueRuntime({ app, components? })`
142
142
 
143
143
  Vue 运行时注册函数。建议在 `createApp` 后、`mount` 前调用。
144
144
 
@@ -147,6 +147,30 @@ Vue 运行时注册函数。建议在 `createApp` 后、`mount` 前调用。
147
147
  - 注册 `FloatingVue`
148
148
  - 注册 `VueKonva`
149
149
  - 注册 SDK 所需全局指令
150
+ - 将 `components` 中的宿主业务组件按名称注册到当前 Vue 应用
151
+
152
+ ### 宿主业务组件
153
+
154
+ 宿主初始化应用时,可将人员选择、消息配置等业务组件一次性传入。Word 在当前应用内的任意组件都可以直接通过组件名使用:
155
+
156
+ ```ts
157
+ import { setupVueRuntime } from '@gct-paas/word';
158
+
159
+ // ApprovalUserSelectConfig、MessageConfig 使用宿主现有组件的 import。
160
+ setupVueRuntime({
161
+ app,
162
+ components: {
163
+ ApprovalUserSelectConfig,
164
+ MessageConfig,
165
+ },
166
+ });
167
+ ```
168
+
169
+ 组件使用 Vue 原生的应用级注册机制,无需 `provide/inject` 或专用 key,也可由宿主自行调用 `app.component(name, component)` 注册。不同 Vue 应用分别注册,Word 不保存宿主应用实例。
170
+
171
+ 消息弹窗留在 Word 内,由入口显式传入当前应用上下文以使用这些组件;其他弹窗继续使用原有挂载方式。独立挂载的弹窗若要使用宿主组件,也需显式传入对应应用上下文。
172
+
173
+ 应用上下文包含应用级插件、全局组件和应用级注入,不包含祖先组件的局部 `provide`。消息表单已提供 `bpmnMainModelKey`;宿主组件若还需要其他局部注入,应在消息入口显式传递。
150
174
 
151
175
  ## 核心运行时 API
152
176
 
@@ -1,6 +1,7 @@
1
+ import { AppContext } from 'vue';
1
2
  import { IModalOptions, IModalInstance } from './modal.type';
2
3
  declare const GctModal: {
3
- open(options: IModalOptions): IModalInstance;
4
+ open(options: IModalOptions, appContext?: AppContext): IModalInstance;
4
5
  confirm(tip: string, cb: () => void): void;
5
6
  };
6
7
  export default GctModal;