feat:fix when call build and onShow at once,then onRenderFinishedCallback maybe called before the render action finished
This commit is contained in:
@@ -704,6 +704,7 @@ class Panel {
|
||||
this.__root__ = new Root;
|
||||
this.headviews = new Map;
|
||||
this.onRenderFinishedCallback = [];
|
||||
this.__rendering__ = false;
|
||||
}
|
||||
onCreate() { }
|
||||
onDestroy() { }
|
||||
@@ -853,9 +854,18 @@ class Panel {
|
||||
}
|
||||
});
|
||||
}
|
||||
Promise.all(promises).then(_ => {
|
||||
this.onRenderFinished();
|
||||
});
|
||||
if (this.__rendering__) {
|
||||
//skip
|
||||
Promise.all(promises).then(_ => {
|
||||
});
|
||||
}
|
||||
else {
|
||||
this.__rendering__ = true;
|
||||
Promise.all(promises).then(_ => {
|
||||
this.__rendering__ = false;
|
||||
this.onRenderFinished();
|
||||
});
|
||||
}
|
||||
}
|
||||
onRenderFinished() {
|
||||
this.onRenderFinishedCallback.forEach(e => {
|
||||
|
||||
Reference in New Issue
Block a user