提交 06ce14bc 作者: 郁骅焌
...@@ -10,7 +10,7 @@ const { TabPane } = Tabs; ...@@ -10,7 +10,7 @@ const { TabPane } = Tabs;
const TabBar = (props) => { const TabBar = (props) => {
const location = useLocation(); const location = useLocation();
const { pathname } = location; let { pathname } = location;
const { const {
menuTree, menuTree,
tabActiveKey, tabActiveKey,
...@@ -18,6 +18,7 @@ const TabBar = (props) => { ...@@ -18,6 +18,7 @@ const TabBar = (props) => {
allPath allPath
} = props; } = props;
pathname = pathname === '/' ? '/home' : pathname
// const [panes, setPanes] = useState([ // const [panes, setPanes] = useState([
// { title: '首页', key: '/home', closable: false }, // { title: '首页', key: '/home', closable: false },
// // { title: '测试标签1', key: '2' }, // // { title: '测试标签1', key: '2' },
......
...@@ -257,7 +257,11 @@ const BasicLayout = (props) => { ...@@ -257,7 +257,11 @@ const BasicLayout = (props) => {
} }
useEffect(() => { useEffect(() => {
const currentPath = location.pathname let currentPath = location.pathname
if (currentPath === '/') {
currentPath = '/home'
}
props.dispatch({ props.dispatch({
type: 'global/updateState', type: 'global/updateState',
payload: { payload: {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论