|
@@ -64,9 +64,6 @@ const query = {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
class BasicLayout extends React.PureComponent {
|
|
class BasicLayout extends React.PureComponent {
|
|
|
- state = {
|
|
|
|
|
- rendering: true,
|
|
|
|
|
- };
|
|
|
|
|
constructor(props) {
|
|
constructor(props) {
|
|
|
super(props);
|
|
super(props);
|
|
|
const { menuData } = this.props;
|
|
const { menuData } = this.props;
|
|
@@ -74,6 +71,28 @@ class BasicLayout extends React.PureComponent {
|
|
|
// Because there are many places to be. So put it here
|
|
// Because there are many places to be. So put it here
|
|
|
this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
|
|
this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ state = {
|
|
|
|
|
+ rendering: true,
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
|
|
+ componentDidMount() {
|
|
|
|
|
+ this.renderRef = requestAnimationFrame(() => {
|
|
|
|
|
+ this.setState({
|
|
|
|
|
+ rendering: false,
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ componentDidUpdate() {
|
|
|
|
|
+ const { menuData } = this.props;
|
|
|
|
|
+ this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ componentWillUnmount() {
|
|
|
|
|
+ cancelAnimationFrame(this.renderRef);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
getContext() {
|
|
getContext() {
|
|
|
const { location } = this.props;
|
|
const { location } = this.props;
|
|
|
return {
|
|
return {
|
|
@@ -81,10 +100,7 @@ class BasicLayout extends React.PureComponent {
|
|
|
breadcrumbNameMap: this.breadcrumbNameMap,
|
|
breadcrumbNameMap: this.breadcrumbNameMap,
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
- componentDidUpdate() {
|
|
|
|
|
- const { menuData } = this.props;
|
|
|
|
|
- this.breadcrumbNameMap = getBreadcrumbNameMap(menuData);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
getPageTitle = pathname => {
|
|
getPageTitle = pathname => {
|
|
|
let currRouterData = null;
|
|
let currRouterData = null;
|
|
|
// match params path
|
|
// match params path
|
|
@@ -149,16 +165,7 @@ class BasicLayout extends React.PureComponent {
|
|
|
payload: collapsed,
|
|
payload: collapsed,
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
- componentDidMount() {
|
|
|
|
|
- this.renderRef = requestAnimationFrame(() => {
|
|
|
|
|
- this.setState({
|
|
|
|
|
- rendering: false,
|
|
|
|
|
- });
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
- componentWillUnmount() {
|
|
|
|
|
- cancelAnimationFrame(this.renderRef);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+
|
|
|
render() {
|
|
render() {
|
|
|
const {
|
|
const {
|
|
|
isMobile,
|
|
isMobile,
|