diff --git a/src/layouts/BasicLayout.js b/src/layouts/BasicLayout.js
index 3ba0ad3c6676cff64d3892f5e2c097618325c618..307a15b67fb19f2faa1df91c85c47a0b46d23bd3 100644
--- a/src/layouts/BasicLayout.js
+++ b/src/layouts/BasicLayout.js
@@ -203,6 +203,15 @@ class BasicLayout extends React.PureComponent {
});
return groupBy(newNotices, 'type');
}
+ getRouteComponent(item) {
+ if (this.routeComponents[item.path]) {
+ return this.routeComponents[item.path];
+ }
+ const component = item.component(this.props.app);
+ this.routeComponents[item.path] = component;
+ return component;
+ }
+ routeComponents = {};
handleOpenChange = (openKeys) => {
const lastOpenKey = openKeys[openKeys.length - 1];
const isMainMenu = this.menus.some(
@@ -239,7 +248,7 @@ class BasicLayout extends React.PureComponent {
}
}
render() {
- const { app, currentUser, collapsed, fetchingNotices } = this.props;
+ const { currentUser, collapsed, fetchingNotices } = this.props;
const menu = (