mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-26 12:18:21 +00:00
fix: 提前 simulator mount 的时间点, 修复极低概率出现的 style 丢失现象
This commit is contained in:
parent
ca4222a98e
commit
b65460f029
@ -23,9 +23,10 @@ export class BuiltinSimulatorHostView extends Component<SimulatorHostProps> {
|
|||||||
|
|
||||||
constructor(props: any) {
|
constructor(props: any) {
|
||||||
super(props);
|
super(props);
|
||||||
const { project } = this.props;
|
const { project, onMount } = this.props;
|
||||||
this.host = (project.simulator as BuiltinSimulatorHost) || new BuiltinSimulatorHost(project);
|
this.host = (project.simulator as BuiltinSimulatorHost) || new BuiltinSimulatorHost(project);
|
||||||
this.host.setProps(this.props);
|
this.host.setProps(this.props);
|
||||||
|
onMount?.(this.host);
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps: BuiltinSimulatorProps) {
|
shouldComponentUpdate(nextProps: BuiltinSimulatorProps) {
|
||||||
@ -33,12 +34,6 @@ export class BuiltinSimulatorHostView extends Component<SimulatorHostProps> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
|
||||||
if (this.props.onMount) {
|
|
||||||
this.props.onMount(this.host);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<div className="lc-simulator">
|
<div className="lc-simulator">
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user