diff --git a/theme/default/layout/BasicLayout.js b/theme/default/layout/BasicLayout.js index a58aff2..e110145 100644 --- a/theme/default/layout/BasicLayout.js +++ b/theme/default/layout/BasicLayout.js @@ -21,6 +21,17 @@ export default class BasicLayout extends PureComponent { super(props); this.state = {}; } + componentDidUpdate() { + this.scrollToTop(); + } + componentDidMount() { + this.scrollToTop(); + } + scrollToTop() { + document.body.scrollTop = 0; + document.documentElement.scrollTop = 0; + window.scrollTo(0, 0); + } renderSubMenuItem(menus) { const { location: { pathname } } = this.props; if (menus.length > 1) {