fix: Menu status

This commit is contained in:
LoadChange 2019-01-17 23:08:02 +08:00 committed by Asa
parent aafd30eb2b
commit fdd4521a64
2 changed files with 10 additions and 1 deletions

View File

@ -20,6 +20,8 @@ import $ from 'jquery';
import { setParams } from '../globalLib';
import { connect } from 'react-redux';
import './index.scss';
@withRouter
@connect(state => ({ ...state.locale }))
@ConfigProvider.config
@ -201,7 +203,8 @@ class MainLayout extends React.Component {
}
nacosLoopNav(data, _index = 0, parent) {
const { locale = {} } = this.props;
const { locale = {}, location = {} } = this.props;
const { pathname } = location;
let index = _index;
// 遍历导航只显示2级
const self = this;
@ -238,6 +241,7 @@ class MainLayout extends React.Component {
} else {
return (
<li
className={pathname === `/${item.serviceName}` ? 'selected' : ''}
key={`${item.serviceName}`}
data-spm-click={`gostr=/aliyun;locaid=${item.serviceName}`}
onClick={this.navTo.bind(this, `/${item.serviceName}`)}
@ -256,6 +260,7 @@ class MainLayout extends React.Component {
}
return (
<li
className={pathname === `/${item.serviceName}` ? 'selected' : ''}
key={`${item.serviceName}`}
data-spm-click={`gostr=/aliyun;locaid=${item.serviceName}`}
onClick={this.navTo.bind(this, `/${item.serviceName}`)}

View File

@ -1394,3 +1394,7 @@ h6 {
padding-right: 20px;
}
}
.product-nav-list li.selected a {
background-color: #F4F6F8;
}