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

修复面包屑导航链接错误

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