提交 2f717e79 authored 作者: vipcxj's avatar vipcxj

修复面包屑导航链接错误

上级 528a1f31
......@@ -3,10 +3,8 @@ import PropTypes from 'prop-types';
import { Menu, Breadcrumb, Icon } from 'antd';
import { connect } from 'dva';
import { Link } from 'dva/router';
import { fullPath } from '../../utils/helper';
import styles from './header.less';
const MenuItem = Menu.Item;
const SubMenu = Menu.SubMenu;
class HeaderPane extends React.Component {
......@@ -50,7 +48,7 @@ class HeaderPane extends React.Component {
return <Icon type="home" />;
}
const bread = route.name ? route.name : route.path;
return <Link to={fullPath(`/${paths.join('/')}`)}>{ bread }</Link>;
return <Link to={`/${paths.join('/')}`}>{ bread }</Link>;
},
};
const menuProps = {
......@@ -65,19 +63,19 @@ class HeaderPane extends React.Component {
<Breadcrumb {...breadsProps} />
<Menu {...menuProps}>
<SubMenu title={userTitle} key="user" >
<MenuItem key="logout">
<Menu.Item key="logout">
<span>
<Icon type="logout" />
登出
</span>
</MenuItem>
</Menu.Item>
</SubMenu>
<SubMenu title={domainTitle} key="domain">
{
domainList.map(dm => (
<MenuItem key={dm.path}>
<Menu.Item key={dm.path}>
{ dm.name }
</MenuItem>
</Menu.Item>
))
}
</SubMenu>
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论