fix: 二级导航偏移的bug

This commit is contained in:
wenbo.dong 2017-08-23 22:04:05 +08:00
parent 423f306d62
commit 2b7ffc7530
3 changed files with 7 additions and 1 deletions

View File

@ -13,7 +13,8 @@
.logo {
position: relative;
float: left;
line-height: .54rem;
line-height: .56rem;
height: .56rem;
.href {
text-decoration: none;
}

View File

@ -24,6 +24,10 @@ class Subnav extends Component {
className="g-row m-subnav-menu"
>
{this.props.data.map((item, index) => {
// 若导航标题为两个字,则自动在中间加个空格
if (item.name.length === 2) {
item.name = item.name[0] + ' ' + item.name[1];
}
return (
<Menu.Item className="item" key={item.name}>
<Link to={item.path}>{this.props.data[index].name}</Link>

View File

@ -8,6 +8,7 @@
border: none;
.m-subnav-menu {
border: none;
padding: 0 .24rem;
.item {
line-height: .54rem;
padding: 0 .36rem;