修复pageTitle

This commit is contained in:
hanhh
2021-09-18 23:27:50 +08:00
parent 39fb23c025
commit 646443deb5
4 changed files with 12 additions and 32 deletions
-3
View File
@@ -62,9 +62,6 @@ export default {
},
],
},
location: {
pathname: '/',
},
navTheme: 'light',
fixSiderbar: true,
contentWidth: 'Fixed',
+6 -4
View File
@@ -56,9 +56,6 @@ export default function (props: any) {
history.push('/login');
}
vhCheck();
// patch custome layout title as react node [object, object]
document.title = '控制面板';
}, []);
useEffect(() => {
@@ -135,7 +132,12 @@ export default function (props: any) {
},
];
}}
pageTitleRender={() => '控制面板'}
pageTitleRender={(props, pageName, info) => {
if (info) {
return `${info.pageName} - 控制面板`;
}
return '控制面板';
}}
{...defaultProps}
>
{React.Children.map(props.children, (child) => {