Commit bfe13935 authored by jljsj's avatar jljsj

fix #1215

parent 558f73b6
...@@ -6,7 +6,7 @@ import { connect } from 'dva'; ...@@ -6,7 +6,7 @@ import { connect } from 'dva';
import { Route, Redirect, Switch, routerRedux } from 'dva/router'; import { Route, Redirect, Switch, routerRedux } from 'dva/router';
import { ContainerQuery } from 'react-container-query'; import { ContainerQuery } from 'react-container-query';
import classNames from 'classnames'; import classNames from 'classnames';
import { enquireScreen } from 'enquire-js'; import { enquireScreen, unenquireScreen } from 'enquire-js';
import GlobalHeader from '../components/GlobalHeader'; import GlobalHeader from '../components/GlobalHeader';
import GlobalFooter from '../components/GlobalFooter'; import GlobalFooter from '../components/GlobalFooter';
import SiderMenu from '../components/SiderMenu'; import SiderMenu from '../components/SiderMenu';
...@@ -99,7 +99,7 @@ class BasicLayout extends React.PureComponent { ...@@ -99,7 +99,7 @@ class BasicLayout extends React.PureComponent {
}; };
} }
componentDidMount() { componentDidMount() {
enquireScreen(mobile => { this.enquireHandler = enquireScreen(mobile => {
this.setState({ this.setState({
isMobile: mobile, isMobile: mobile,
}); });
...@@ -108,6 +108,9 @@ class BasicLayout extends React.PureComponent { ...@@ -108,6 +108,9 @@ class BasicLayout extends React.PureComponent {
type: 'user/fetchCurrent', type: 'user/fetchCurrent',
}); });
} }
componentWillUnmount(){
unenquireScreen(this.enquireHandler);
}
getPageTitle() { getPageTitle() {
const { routerData, location } = this.props; const { routerData, location } = this.props;
const { pathname } = location; const { pathname } = location;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment