Commit d233a8b8 authored by 邓超's avatar 邓超

fix: 路由按需加载

parent 76477a88
Pipeline #61453 waiting for manual action with stages
.mobileContainer {
height: 100%;
.ant-tabs {
height: 100%;
.ant-tabs-content {
height: 100%;
}
}
.ant-pro-card {
height: 100%;
}
}
\ No newline at end of file
import React from 'react';
export default function asyncComponent(importComponent) {
class AsyncComponent extends React.Component {
constructor(props) {
super(props);
this.state = { component: null };
}
componentDidMount() {
importComponent().then(mod => {
this.setState({
component: mod.default ? mod.default : mod,
});
});
}
render() {
const C = this.state.component;
return C ? <C {...this.props} /> : null;
}
}
return AsyncComponent;
}
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