fix: Menu status
This commit is contained in:
parent
aafd30eb2b
commit
fdd4521a64
@ -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}`)}
|
||||
|
@ -1394,3 +1394,7 @@ h6 {
|
||||
padding-right: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
.product-nav-list li.selected a {
|
||||
background-color: #F4F6F8;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user