module-menu 0.0.6 → 0.0.8
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/.editorconfig +16 -0
- package/.prettierignore +8 -0
- package/.prettierrc +11 -0
- package/.umirc.js +11 -0
- package/README.md +10 -65
- package/dist/index.html +22 -0
- package/dist/static/childIcon.797194d8.svg +10 -0
- package/dist/static/home.c9f8fbce.svg +12 -0
- package/dist/static/menuIcon.a281e69f.svg +1 -0
- package/dist/static/module.287d1998.svg +12 -0
- package/dist/umi.css +1 -0
- package/dist/umi.js +1 -0
- package/mock/.gitkeep +0 -0
- package/package.json +29 -31
- package/src/.umi/.cache/babel-loader/006cd391c2d71e6cf49cff32a7d7e7ea.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/0338b3888dd146dd07b8a2dadae22515.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/046a6f14bf358d879b171cc3fd01a7f1.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/06653d4063f1fa0a78dbe664c4d942a2.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/07946a12d045541a6da81e832a157386.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/098a5cfe0e14aa583144c71244bbaf0d.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/0bd5919b2a2a3a6672ace3392d7b54c7.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/0e803b5601d075064d8a5641f3170e96.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/2cd50d901ae2e761fb8b68217d063338.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/31ec5214ed0e837a88908074a704a9f2.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/3516c56d068efdb601a4ab92380d0d8d.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/38fe4fe93f78903424446b2670dd881a.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/3f4c30e441ca71253594a5f549c83e5d.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/43a5d580c6a2da6134a17edcf7b87084.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/61996ca5ddd9a40ea57e9b8e8208c140.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/6432db849c9ee59480c90f5c482cd5b2.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/77b6cd8f61f66fa2458792503a65eb37.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/7944475811983ddaa4b770f627624e0d.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/7b4983c7428750b20c354ecb1cc6226f.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/c1e4065a5c16bb60e0dad17fd17e4d21.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/c5f25455f80accb4389a63e966193658.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/d5cec1443884c84dea19b626dff4a130.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/d7d65bbebb7d2a6933b8994ed54ba1f4.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/d8e03990d8e0f543ddd2c8b7c1986b6e.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/d94d2cccf8876adaf96c9792ae1604d7.json.gz +0 -0
- package/src/.umi/.cache/babel-loader/e76ddc963361774c561993f62f13cd1c.json.gz +0 -0
- package/src/.umi/core/devScripts.ts +53 -0
- package/src/.umi/core/history.ts +21 -0
- package/src/.umi/core/plugin.ts +8 -0
- package/src/.umi/core/pluginConfig.d.ts +304 -0
- package/src/.umi/core/pluginRegister.ts +15 -0
- package/src/.umi/core/polyfill.ts +4 -0
- package/src/.umi/core/routes.ts +24 -0
- package/src/.umi/core/umiExports.ts +7 -0
- package/src/.umi/plugin-helmet/exports.ts +3 -0
- package/src/.umi/plugin-initial-state/Provider.tsx +37 -0
- package/src/.umi/plugin-initial-state/exports.ts +7 -0
- package/src/.umi/plugin-initial-state/models/initialState.ts +2 -0
- package/src/.umi/plugin-initial-state/runtime.tsx +13 -0
- package/src/.umi/plugin-model/Provider.tsx +39 -0
- package/src/.umi/plugin-model/helpers/constant.tsx +4 -0
- package/src/.umi/plugin-model/helpers/dispatcher.tsx +19 -0
- package/src/.umi/plugin-model/helpers/executor.tsx +83 -0
- package/src/.umi/plugin-model/runtime.tsx +12 -0
- package/src/.umi/plugin-model/useModel.tsx +71 -0
- package/src/.umi/plugin-request/request.ts +278 -0
- package/src/.umi/umi.ts +58 -0
- package/src/{App.js → pages/index.jsx} +15 -17
- package/src/{App.css → pages/index.less} +68 -68
- package/tsconfig.json +37 -0
- package/typings.d.ts +10 -0
- package/package-lock.json +0 -30410
- package/public/index.html +0 -14
- package/public/robots.txt +0 -3
- package/src/index.js +0 -11
package/mock/.gitkeep
ADDED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "module-menu",
|
|
3
|
-
"
|
|
4
|
-
"version": "0.0.6",
|
|
3
|
+
"version": "0.0.8",
|
|
5
4
|
"description": "城市大数据平台菜单",
|
|
6
|
-
"dependencies": {
|
|
7
|
-
"@testing-library/jest-dom": "^5.16.5",
|
|
8
|
-
"@testing-library/react": "^13.4.0",
|
|
9
|
-
"@testing-library/user-event": "^13.5.0",
|
|
10
|
-
"antd": "^5.6.1",
|
|
11
|
-
"react": "^18.2.0",
|
|
12
|
-
"react-dom": "^18.2.0",
|
|
13
|
-
"react-scripts": "5.0.1",
|
|
14
|
-
"web-vitals": "^2.1.4"
|
|
15
|
-
},
|
|
16
5
|
"scripts": {
|
|
17
|
-
"start": "
|
|
18
|
-
"build": "
|
|
19
|
-
"
|
|
20
|
-
"
|
|
6
|
+
"start": "umi dev",
|
|
7
|
+
"build": "umi build",
|
|
8
|
+
"postinstall": "umi generate tmp",
|
|
9
|
+
"prettier": "prettier --write '**/*.{js,jsx,tsx,ts,less,md,json}'",
|
|
10
|
+
"test": "umi-test",
|
|
11
|
+
"test:coverage": "umi-test --coverage"
|
|
21
12
|
},
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"react-app",
|
|
25
|
-
"react-app/jest"
|
|
26
|
-
]
|
|
13
|
+
"gitHooks": {
|
|
14
|
+
"pre-commit": "lint-staged"
|
|
27
15
|
},
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"not dead",
|
|
32
|
-
"not op_mini all"
|
|
16
|
+
"lint-staged": {
|
|
17
|
+
"*.{js,jsx,less,md,json}": [
|
|
18
|
+
"prettier --write"
|
|
33
19
|
],
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"last 1 firefox version",
|
|
37
|
-
"last 1 safari version"
|
|
20
|
+
"*.ts?(x)": [
|
|
21
|
+
"prettier --parser=typescript --write"
|
|
38
22
|
]
|
|
39
23
|
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@ant-design/pro-layout": "^6.5.0",
|
|
26
|
+
"antd": "^5.6.1",
|
|
27
|
+
"react": "17.x",
|
|
28
|
+
"react-dom": "17.x",
|
|
29
|
+
"umi": "^3.5.41"
|
|
30
|
+
},
|
|
40
31
|
"devDependencies": {
|
|
41
|
-
"
|
|
32
|
+
"@types/react": "^17.0.0",
|
|
33
|
+
"@types/react-dom": "^17.0.0",
|
|
34
|
+
"@umijs/preset-react": "1.x",
|
|
35
|
+
"@umijs/test": "^3.5.41",
|
|
36
|
+
"lint-staged": "^10.0.7",
|
|
37
|
+
"prettier": "^2.2.0",
|
|
38
|
+
"typescript": "^4.1.2",
|
|
39
|
+
"yorkie": "^2.0.0"
|
|
42
40
|
}
|
|
43
41
|
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
if (window.g_initWebpackHotDevClient) {
|
|
4
|
+
function tryApplyUpdates(onHotUpdateSuccess?: Function) {
|
|
5
|
+
// @ts-ignore
|
|
6
|
+
if (!module.hot) {
|
|
7
|
+
window.location.reload();
|
|
8
|
+
return;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function isUpdateAvailable() {
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
return window.g_getMostRecentCompilationHash() !== __webpack_hash__;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// TODO: is update available?
|
|
17
|
+
// @ts-ignore
|
|
18
|
+
if (!isUpdateAvailable() || module.hot.status() !== 'idle') {
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function handleApplyUpdates(err: Error | null, updatedModules: any) {
|
|
23
|
+
if (err || !updatedModules || window.g_getHadRuntimeError()) {
|
|
24
|
+
window.location.reload();
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
onHotUpdateSuccess?.();
|
|
29
|
+
|
|
30
|
+
if (isUpdateAvailable()) {
|
|
31
|
+
// While we were updating, there was a new update! Do it again.
|
|
32
|
+
tryApplyUpdates();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// @ts-ignore
|
|
37
|
+
module.hot.check(true).then(
|
|
38
|
+
function (updatedModules: any) {
|
|
39
|
+
handleApplyUpdates(null, updatedModules);
|
|
40
|
+
},
|
|
41
|
+
function (err: Error) {
|
|
42
|
+
handleApplyUpdates(err, null);
|
|
43
|
+
},
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
window.g_initWebpackHotDevClient({
|
|
48
|
+
tryApplyUpdates,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export const __mfsu = 1;
|
|
53
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { createBrowserHistory, History } from 'D:/NewGitPro/module-menu/node_modules/umi/node_modules/@umijs/runtime';
|
|
3
|
+
|
|
4
|
+
let options = {
|
|
5
|
+
"basename": "/"
|
|
6
|
+
};
|
|
7
|
+
if ((<any>window).routerBase) {
|
|
8
|
+
options.basename = (<any>window).routerBase;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// remove initial history because of ssr
|
|
12
|
+
let history: History = process.env.__IS_SERVER ? null : createBrowserHistory(options);
|
|
13
|
+
export const createHistory = (hotReload = false) => {
|
|
14
|
+
if (!hotReload) {
|
|
15
|
+
history = createBrowserHistory(options);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
return history;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export { history };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { Plugin } from 'D:/NewGitPro/module-menu/node_modules/umi/node_modules/@umijs/runtime';
|
|
3
|
+
|
|
4
|
+
const plugin = new Plugin({
|
|
5
|
+
validKeys: ['modifyClientRenderOpts','patchRoutes','rootContainer','render','onRouteChange','__mfsu','getInitialState','initialStateConfig','request',],
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export { plugin };
|
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
// Created by Umi Plugin
|
|
2
|
+
|
|
3
|
+
export interface IConfigFromPlugins {
|
|
4
|
+
"404"?: boolean
|
|
5
|
+
routes?: {
|
|
6
|
+
/**
|
|
7
|
+
* Any valid URL path
|
|
8
|
+
*/
|
|
9
|
+
path?: string
|
|
10
|
+
/**
|
|
11
|
+
* A React component to render only when the location matches.
|
|
12
|
+
*/
|
|
13
|
+
component?: (string | (() => any))
|
|
14
|
+
wrappers?: string[]
|
|
15
|
+
/**
|
|
16
|
+
* navigate to a new location
|
|
17
|
+
*/
|
|
18
|
+
redirect?: string
|
|
19
|
+
/**
|
|
20
|
+
* When true, the active class/style will only be applied if the location is matched exactly.
|
|
21
|
+
*/
|
|
22
|
+
exact?: boolean
|
|
23
|
+
routes?: any[]
|
|
24
|
+
[k: string]: any
|
|
25
|
+
}[]
|
|
26
|
+
history?: {
|
|
27
|
+
type?: ("browser" | "hash" | "memory")
|
|
28
|
+
options?: {
|
|
29
|
+
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
polyfill?: {
|
|
33
|
+
imports?: string[]
|
|
34
|
+
}
|
|
35
|
+
alias?: {
|
|
36
|
+
|
|
37
|
+
}
|
|
38
|
+
analyze?: {
|
|
39
|
+
analyzerMode?: ("server" | "static" | "disabled")
|
|
40
|
+
analyzerHost?: string
|
|
41
|
+
analyzerPort?: any
|
|
42
|
+
openAnalyzer?: boolean
|
|
43
|
+
generateStatsFile?: boolean
|
|
44
|
+
statsFilename?: string
|
|
45
|
+
logLevel?: ("info" | "warn" | "error" | "silent")
|
|
46
|
+
defaultSizes?: ("stat" | "parsed" | "gzip")
|
|
47
|
+
[k: string]: any
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* postcss autoprefixer, default flexbox: no-2009
|
|
51
|
+
*/
|
|
52
|
+
autoprefixer?: {
|
|
53
|
+
|
|
54
|
+
}
|
|
55
|
+
base?: string
|
|
56
|
+
chainWebpack?: (() => any)
|
|
57
|
+
chunks?: string[]
|
|
58
|
+
/**
|
|
59
|
+
* more css-loader options see https://webpack.js.org/loaders/css-loader/#options
|
|
60
|
+
*/
|
|
61
|
+
cssLoader?: {
|
|
62
|
+
url?: (boolean | (() => any))
|
|
63
|
+
import?: (boolean | (() => any))
|
|
64
|
+
modules?: (boolean | string | {
|
|
65
|
+
|
|
66
|
+
})
|
|
67
|
+
sourceMap?: boolean
|
|
68
|
+
importLoaders?: number
|
|
69
|
+
onlyLocals?: boolean
|
|
70
|
+
esModule?: boolean
|
|
71
|
+
localsConvention?: ("asIs" | "camelCase" | "camelCaseOnly" | "dashes" | "dashesOnly")
|
|
72
|
+
}
|
|
73
|
+
cssModulesTypescriptLoader?: {
|
|
74
|
+
mode?: ("emit" | "verify")
|
|
75
|
+
}
|
|
76
|
+
cssnano?: {
|
|
77
|
+
|
|
78
|
+
}
|
|
79
|
+
copy?: any[]
|
|
80
|
+
define?: {
|
|
81
|
+
|
|
82
|
+
}
|
|
83
|
+
devScripts?: {
|
|
84
|
+
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* devServer configs
|
|
88
|
+
*/
|
|
89
|
+
devServer?: {
|
|
90
|
+
/**
|
|
91
|
+
* devServer port, default 8000
|
|
92
|
+
*/
|
|
93
|
+
port?: number
|
|
94
|
+
host?: string
|
|
95
|
+
https?: ({
|
|
96
|
+
key?: string
|
|
97
|
+
cert?: string
|
|
98
|
+
http2?: boolean
|
|
99
|
+
[k: string]: any
|
|
100
|
+
} | boolean)
|
|
101
|
+
headers?: {
|
|
102
|
+
|
|
103
|
+
}
|
|
104
|
+
writeToDisk?: (boolean | (() => any))
|
|
105
|
+
[k: string]: any
|
|
106
|
+
}
|
|
107
|
+
devtool?: string
|
|
108
|
+
/**
|
|
109
|
+
* Code splitting for performance optimization
|
|
110
|
+
*/
|
|
111
|
+
dynamicImport?: {
|
|
112
|
+
/**
|
|
113
|
+
* loading the component before loaded
|
|
114
|
+
*/
|
|
115
|
+
loading?: string
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Code splitting for import statement syntax
|
|
119
|
+
*/
|
|
120
|
+
dynamicImportSyntax?: {
|
|
121
|
+
|
|
122
|
+
}
|
|
123
|
+
exportStatic?: {
|
|
124
|
+
htmlSuffix?: boolean
|
|
125
|
+
dynamicRoot?: boolean
|
|
126
|
+
supportWin?: boolean
|
|
127
|
+
/**
|
|
128
|
+
* extra render paths only enable in ssr
|
|
129
|
+
*/
|
|
130
|
+
extraRoutePaths?: (() => any)
|
|
131
|
+
}
|
|
132
|
+
externals?: ({
|
|
133
|
+
|
|
134
|
+
} | string | (() => any))
|
|
135
|
+
extraBabelIncludes?: any[]
|
|
136
|
+
extraBabelPlugins?: any[]
|
|
137
|
+
extraBabelPresets?: any[]
|
|
138
|
+
extraPostCSSPlugins?: any[]
|
|
139
|
+
/**
|
|
140
|
+
* fork-ts-checker-webpack-plugin options see https://github.com/TypeStrong/fork-ts-checker-webpack-plugin#options
|
|
141
|
+
*/
|
|
142
|
+
forkTSChecker?: {
|
|
143
|
+
async?: boolean
|
|
144
|
+
typescript?: (boolean | {
|
|
145
|
+
|
|
146
|
+
})
|
|
147
|
+
eslint?: {
|
|
148
|
+
|
|
149
|
+
}
|
|
150
|
+
issue?: {
|
|
151
|
+
|
|
152
|
+
}
|
|
153
|
+
formatter?: (string | {
|
|
154
|
+
|
|
155
|
+
})
|
|
156
|
+
logger?: {
|
|
157
|
+
|
|
158
|
+
}
|
|
159
|
+
[k: string]: any
|
|
160
|
+
}
|
|
161
|
+
fastRefresh?: {
|
|
162
|
+
|
|
163
|
+
}
|
|
164
|
+
hash?: boolean
|
|
165
|
+
ignoreMomentLocale?: boolean
|
|
166
|
+
inlineLimit?: number
|
|
167
|
+
lessLoader?: {
|
|
168
|
+
|
|
169
|
+
}
|
|
170
|
+
manifest?: {
|
|
171
|
+
fileName?: string
|
|
172
|
+
publicPath?: ""
|
|
173
|
+
basePath?: string
|
|
174
|
+
writeToFileEmit?: boolean
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* open mfsu feature
|
|
178
|
+
*/
|
|
179
|
+
mfsu?: {
|
|
180
|
+
development?: {
|
|
181
|
+
output?: string
|
|
182
|
+
}
|
|
183
|
+
production?: {
|
|
184
|
+
output?: string
|
|
185
|
+
}
|
|
186
|
+
mfName?: string
|
|
187
|
+
exportAllMembers?: {
|
|
188
|
+
|
|
189
|
+
}
|
|
190
|
+
chunks?: string[]
|
|
191
|
+
ignoreNodeBuiltInModules?: boolean
|
|
192
|
+
}
|
|
193
|
+
mountElementId?: ""
|
|
194
|
+
mpa?: {
|
|
195
|
+
|
|
196
|
+
}
|
|
197
|
+
nodeModulesTransform?: {
|
|
198
|
+
type?: ("all" | "none")
|
|
199
|
+
exclude?: string[]
|
|
200
|
+
}
|
|
201
|
+
outputPath?: ""
|
|
202
|
+
plugins?: string[]
|
|
203
|
+
postcssLoader?: {
|
|
204
|
+
|
|
205
|
+
}
|
|
206
|
+
presets?: string[]
|
|
207
|
+
proxy?: {
|
|
208
|
+
|
|
209
|
+
}
|
|
210
|
+
publicPath?: string
|
|
211
|
+
runtimePublicPath?: boolean
|
|
212
|
+
ssr?: {
|
|
213
|
+
/**
|
|
214
|
+
* force execing Page getInitialProps functions
|
|
215
|
+
*/
|
|
216
|
+
forceInitial?: boolean
|
|
217
|
+
/**
|
|
218
|
+
* remove window.g_initialProps in html
|
|
219
|
+
*/
|
|
220
|
+
removeWindowInitialProps?: boolean
|
|
221
|
+
/**
|
|
222
|
+
* disable serve-side render in umi dev mode.
|
|
223
|
+
*/
|
|
224
|
+
devServerRender?: boolean
|
|
225
|
+
mode?: ("stream" | "string")
|
|
226
|
+
/**
|
|
227
|
+
* static markup in static site
|
|
228
|
+
*/
|
|
229
|
+
staticMarkup?: boolean
|
|
230
|
+
}
|
|
231
|
+
singular?: boolean
|
|
232
|
+
styleLoader?: {
|
|
233
|
+
|
|
234
|
+
}
|
|
235
|
+
targets?: {
|
|
236
|
+
|
|
237
|
+
}
|
|
238
|
+
terserOptions?: {
|
|
239
|
+
|
|
240
|
+
}
|
|
241
|
+
theme?: {
|
|
242
|
+
|
|
243
|
+
}
|
|
244
|
+
runtimeHistory?: {
|
|
245
|
+
|
|
246
|
+
}
|
|
247
|
+
webpack5?: {
|
|
248
|
+
lazyCompilation?: {
|
|
249
|
+
entries?: boolean
|
|
250
|
+
imports?: boolean
|
|
251
|
+
test?: any
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
workerLoader?: {
|
|
255
|
+
|
|
256
|
+
}
|
|
257
|
+
favicon?: string
|
|
258
|
+
headScripts?: any[]
|
|
259
|
+
links?: any[]
|
|
260
|
+
metas?: any[]
|
|
261
|
+
scripts?: any[]
|
|
262
|
+
styles?: any[]
|
|
263
|
+
title?: string
|
|
264
|
+
mock?: {
|
|
265
|
+
exclude?: string[]
|
|
266
|
+
}
|
|
267
|
+
antd?: {
|
|
268
|
+
dark?: boolean
|
|
269
|
+
compact?: boolean
|
|
270
|
+
mobile?: boolean
|
|
271
|
+
disableBabelPluginImport?: boolean
|
|
272
|
+
config?: {
|
|
273
|
+
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
dva?: {
|
|
277
|
+
disableModelsReExport?: boolean
|
|
278
|
+
/**
|
|
279
|
+
* lazy load dva model avoiding the import modules from umi undefined
|
|
280
|
+
*/
|
|
281
|
+
lazyLoad?: boolean
|
|
282
|
+
extraModels?: string[]
|
|
283
|
+
hmr?: boolean
|
|
284
|
+
immer?: (boolean | {
|
|
285
|
+
|
|
286
|
+
})
|
|
287
|
+
skipModelValidate?: boolean
|
|
288
|
+
}
|
|
289
|
+
locale?: {
|
|
290
|
+
default?: string
|
|
291
|
+
useLocalStorage?: boolean
|
|
292
|
+
baseNavigator?: boolean
|
|
293
|
+
title?: boolean
|
|
294
|
+
antd?: boolean
|
|
295
|
+
baseSeparator?: string
|
|
296
|
+
}
|
|
297
|
+
layout?: {
|
|
298
|
+
|
|
299
|
+
}
|
|
300
|
+
request?: {
|
|
301
|
+
dataField?: ""
|
|
302
|
+
}
|
|
303
|
+
[k: string]: any
|
|
304
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import { plugin } from './plugin';
|
|
3
|
+
import * as Plugin_0 from '../plugin-initial-state/runtime';
|
|
4
|
+
import * as Plugin_1 from '../plugin-model/runtime';
|
|
5
|
+
|
|
6
|
+
plugin.register({
|
|
7
|
+
apply: Plugin_0,
|
|
8
|
+
path: '../plugin-initial-state/runtime',
|
|
9
|
+
});
|
|
10
|
+
plugin.register({
|
|
11
|
+
apply: Plugin_1,
|
|
12
|
+
path: '../plugin-model/runtime',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const __mfsu = 1;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { ApplyPluginsType } from 'D:/NewGitPro/module-menu/node_modules/umi/node_modules/@umijs/runtime';
|
|
4
|
+
import * as umiExports from './umiExports';
|
|
5
|
+
import { plugin } from './plugin';
|
|
6
|
+
|
|
7
|
+
export function getRoutes() {
|
|
8
|
+
const routes = [
|
|
9
|
+
{
|
|
10
|
+
"path": "/",
|
|
11
|
+
"component": require('@/pages/index').default,
|
|
12
|
+
"exact": true
|
|
13
|
+
}
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
// allow user to extend routes
|
|
17
|
+
plugin.applyPlugins({
|
|
18
|
+
key: 'patchRoutes',
|
|
19
|
+
type: ApplyPluginsType.event,
|
|
20
|
+
args: { routes },
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
return routes;
|
|
24
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
export { history } from './history';
|
|
3
|
+
export { plugin } from './plugin';
|
|
4
|
+
export * from '../plugin-initial-state/exports';
|
|
5
|
+
export * from '../plugin-model/useModel';
|
|
6
|
+
export * from '../plugin-request/request';
|
|
7
|
+
export * from '../plugin-helmet/exports';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
|
|
3
|
+
import React, { useRef, useEffect } from "react";
|
|
4
|
+
import { plugin } from "../core/umiExports";
|
|
5
|
+
import { ApplyPluginsType } from 'umi';
|
|
6
|
+
import { useModel } from "../plugin-model/useModel";
|
|
7
|
+
if (typeof useModel !== "function") {
|
|
8
|
+
throw new Error(
|
|
9
|
+
"[plugin-initial-state]: useModel is not a function, @umijs/plugin-model is required."
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface Props {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export default (props: Props) => {
|
|
17
|
+
const { children } = props;
|
|
18
|
+
const appLoaded = useRef(false);
|
|
19
|
+
// 获取用户的配置,暂时只支持 loading
|
|
20
|
+
const useRuntimeConfig =
|
|
21
|
+
plugin.applyPlugins({
|
|
22
|
+
key: "initialStateConfig",
|
|
23
|
+
type: ApplyPluginsType.modify,
|
|
24
|
+
initialValue: {},
|
|
25
|
+
}) || {};
|
|
26
|
+
const { loading = false } = useModel("@@initialState") || {};
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
if (!loading) {
|
|
29
|
+
appLoaded.current = true;
|
|
30
|
+
}
|
|
31
|
+
}, [loading]);
|
|
32
|
+
// initial state loading 时,阻塞渲染
|
|
33
|
+
if (loading && !appLoaded.current) {
|
|
34
|
+
return useRuntimeConfig.loading || null;
|
|
35
|
+
}
|
|
36
|
+
return children;
|
|
37
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// @ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import Provider from './Provider';
|
|
4
|
+
|
|
5
|
+
export function rootContainer(container: React.ReactNode) {
|
|
6
|
+
return React.createElement(
|
|
7
|
+
// 这里的 plugin-initial-state 不能从 constant 里取,里面有 path 依赖
|
|
8
|
+
// 但 webpack-5 没有 node 补丁(包括 path)
|
|
9
|
+
Provider,
|
|
10
|
+
null,
|
|
11
|
+
container,
|
|
12
|
+
);
|
|
13
|
+
}
|