Skip to content

Commit

Permalink
🐛 fix openMenu reset
Browse files Browse the repository at this point in the history
  • Loading branch information
ycjcl868 authored and afc163 committed Jan 10, 2019
1 parent 22a4ca8 commit 7621676
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions site/theme/template/Content/MainContent.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { Link } from 'bisheng/router';
import { Row, Col, Menu, Icon, Affix } from 'antd';
import classNames from 'classnames';
import get from 'lodash/get';
import MobileMenu from 'rc-drawer';
import Article from './Article';
import PrevAndNext from './PrevAndNext';
Expand Down Expand Up @@ -88,6 +89,11 @@ export default class MainContent extends Component {
if (!window.location.hash && prevLocation.pathname !== location.pathname) {
document.documentElement.scrollTop = 0;
}
// when subMenu not equal
if (get(this.props, 'route.path') !== get(prevProps, 'route.path')) {
// reset menu OpenKeys
this.handleMenuOpenChange();
}
setTimeout(() => {
if (
window.location.hash &&
Expand Down

0 comments on commit 7621676

Please sign in to comment.