Showing
2 changed files
with
25 additions
and
6 deletions
src/app.ts
deleted
100644 → 0
src/app.tsx
0 → 100644
1 | +import { ConfigProvider } from 'antd'; | ||
2 | +import { ReactNode } from 'react'; | ||
3 | +import pkg from '../package.json'; | ||
4 | + | ||
5 | +const { name } = pkg; | ||
6 | + | ||
7 | +/** | ||
8 | + * @see https://v3.umijs.org/zh-CN/plugins/plugin-initial-state#getinitialstate | ||
9 | + * */ | ||
10 | +export async function getInitialState(): Promise<{}> { | ||
11 | + return window.qx.getModuleData(); | ||
12 | +} | ||
13 | + | ||
14 | +/** | ||
15 | + * @see https://v3.umijs.org/zh-CN/docs/runtime-config#rootcontainerlastrootcontainer-args | ||
16 | + */ | ||
17 | +export function rootContainer(container: ReactNode) { | ||
18 | + return ( | ||
19 | + <ConfigProvider | ||
20 | + getPopupContainer={() => document.getElementById(name) || document.body} | ||
21 | + > | ||
22 | + {container} | ||
23 | + </ConfigProvider> | ||
24 | + ); | ||
25 | +} |