Commit e38dd2d8 authored by GuanHua's avatar GuanHua

feat:网页标签页标题修改

parent bde37f35
...@@ -105,9 +105,11 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { ...@@ -105,9 +105,11 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
const animationFrameId = requestAnimationFrame(() => { const animationFrameId = requestAnimationFrame(() => {
setSelectedKeys(keys); setSelectedKeys(keys);
}); });
console.log(currentRouter, "currentRouter")
return () => return () =>
window.cancelAnimationFrame && window.cancelAnimationFrame &&
window.cancelAnimationFrame(animationFrameId); window.cancelAnimationFrame(animationFrameId);
}, [location.pathname]); }, [location.pathname]);
useEffect(() => { useEffect(() => {
...@@ -122,9 +124,10 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => { ...@@ -122,9 +124,10 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
setOpenKeys([]) setOpenKeys([])
} }
}, [currentRouter, location.pathname, collapsed]) }, [currentRouter, location.pathname, collapsed])
return ( return (
<ProLayout <ProLayout
title={``} pageTitleRender={() => currentRouter ? currentRouter.name : window.location.href}
style={{ minHeight: '100vh' }} style={{ minHeight: '100vh' }}
logo={logo} logo={logo}
formatMessage={formatMessage} formatMessage={formatMessage}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment