t-lj-service 1.0.1 → 1.0.3
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/module/qiankun/qiankun.ts +11 -5
- package/package.json +1 -1
|
@@ -92,7 +92,7 @@ const _window = (container: HTMLDivElement, type: number = 1) => {
|
|
|
92
92
|
}
|
|
93
93
|
const render = (
|
|
94
94
|
root: ReturnType<typeof createApp>,
|
|
95
|
-
App: Component
|
|
95
|
+
App: Component,
|
|
96
96
|
use: any[] = [],
|
|
97
97
|
id: string = '#container',
|
|
98
98
|
icons: GlobalIcons | null = null,
|
|
@@ -130,7 +130,7 @@ const render = (
|
|
|
130
130
|
|
|
131
131
|
const initQianKun = (
|
|
132
132
|
root: ReturnType<typeof createApp>,
|
|
133
|
-
App: Component
|
|
133
|
+
App: Component,
|
|
134
134
|
use: any[] = [],
|
|
135
135
|
id: string = '#container',
|
|
136
136
|
icons: GlobalIcons | null = null,
|
|
@@ -156,17 +156,23 @@ const initQianKun = (
|
|
|
156
156
|
};
|
|
157
157
|
const useApp = ({
|
|
158
158
|
root = null,
|
|
159
|
-
App
|
|
159
|
+
App,
|
|
160
160
|
use = [],
|
|
161
161
|
id = '#container',
|
|
162
162
|
icons = null,
|
|
163
163
|
}: {
|
|
164
164
|
root?: ReturnType<typeof createApp> | null,
|
|
165
|
-
App?: Component
|
|
165
|
+
App?: Component,
|
|
166
166
|
use?: any[],
|
|
167
167
|
id?: string,
|
|
168
168
|
icons?: GlobalIcons | null,
|
|
169
|
-
} = {}) =>
|
|
169
|
+
} = {}) => {
|
|
170
|
+
if (!App) {
|
|
171
|
+
throw new Error('App 组件不能为空');
|
|
172
|
+
}
|
|
173
|
+
const appRoot = root || createApp(App);
|
|
174
|
+
qiankunWindow.__POWERED_BY_QIANKUN__ ? initQianKun(appRoot, App, use, id, icons) : render(appRoot, App, use, id ,icons)
|
|
175
|
+
};
|
|
170
176
|
|
|
171
177
|
|
|
172
178
|
|