提交 c12da1c9 作者: 郁骅焌

访问/时候没有选中首页tab

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