@fe-free/core 2.3.0 → 2.3.2
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/CHANGELOG.md +14 -0
- package/package.json +2 -2
- package/src/core_app/index.tsx +24 -13
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fe-free/core",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"author": "",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"remark-gfm": "^4.0.1",
|
|
42
42
|
"vanilla-jsoneditor": "^0.23.1",
|
|
43
43
|
"zustand": "^4.5.4",
|
|
44
|
-
"@fe-free/tool": "2.3.
|
|
44
|
+
"@fe-free/tool": "2.3.2"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@ant-design/pro-components": "2.8.9",
|
package/src/core_app/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ProConfigProvider } from '@ant-design/pro-components';
|
|
2
|
+
import { useTitle } from 'ahooks';
|
|
2
3
|
import { App, ConfigProvider } from 'antd';
|
|
3
4
|
import zhCN from 'antd/locale/zh_CN';
|
|
4
5
|
import { useEffect, useMemo } from 'react';
|
|
@@ -15,27 +16,37 @@ function SetRouteTool({ basename }: { basename: string }) {
|
|
|
15
16
|
routeTool.setBaseName(basename);
|
|
16
17
|
}, [navigate, basename]);
|
|
17
18
|
|
|
18
|
-
useEffect(() => {
|
|
19
|
-
// 首页,且 basename 不是 /,一定是要去到 basename 的
|
|
20
|
-
if (location.pathname === '/' && basename !== '/') {
|
|
21
|
-
location.href = basename;
|
|
22
|
-
}
|
|
23
|
-
}, []);
|
|
24
|
-
|
|
25
19
|
return null;
|
|
26
20
|
}
|
|
27
21
|
|
|
28
22
|
/** 提供一些基础的组 APP 功能 */
|
|
29
23
|
function CoreApp(props: {
|
|
30
24
|
basename: string;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
name?: string;
|
|
26
|
+
proConfigProviderProps?: Omit<React.ComponentProps<typeof ProConfigProvider>, 'children'>;
|
|
27
|
+
configProviderProps?: Omit<React.ComponentProps<typeof ConfigProvider>, 'children'>;
|
|
28
|
+
appProps?: Omit<React.ComponentProps<typeof App>, 'children'>;
|
|
29
|
+
routerProps?: Omit<Partial<React.ComponentProps<typeof Router>>, 'children'>;
|
|
35
30
|
children: React.ReactNode;
|
|
36
31
|
}) {
|
|
37
|
-
const {
|
|
38
|
-
|
|
32
|
+
const {
|
|
33
|
+
basename,
|
|
34
|
+
name,
|
|
35
|
+
children,
|
|
36
|
+
proConfigProviderProps,
|
|
37
|
+
configProviderProps,
|
|
38
|
+
appProps,
|
|
39
|
+
routerProps,
|
|
40
|
+
} = props;
|
|
41
|
+
|
|
42
|
+
useTitle(name || '');
|
|
43
|
+
|
|
44
|
+
useEffect(() => {
|
|
45
|
+
// 首页,且 basename 不是 /,一定是要去到 basename 的
|
|
46
|
+
if (window.location.pathname === '/' && basename !== '/') {
|
|
47
|
+
window.location.href = basename;
|
|
48
|
+
}
|
|
49
|
+
}, []);
|
|
39
50
|
|
|
40
51
|
return (
|
|
41
52
|
<ProConfigProvider
|