Browse Source

KERNEL-16950 fix: 优化

research/test
jian 11 months ago
parent
commit
c6d10e42d1
  1. 4
      packages/fineui/src/core/4.widget.js

4
packages/fineui/src/core/4.widget.js

@ -241,7 +241,7 @@ export class Widget extends OB {
if (beforeRenderResult instanceof Promise) { if (beforeRenderResult instanceof Promise) {
beforeRenderResult.then(render).catch((e) => { beforeRenderResult.then(render).catch((e) => {
_global.console && console.error(e); _global.console && console.error(e);
render(); !this.isDestroyed() && render(); // 异步render,改组件此时可能已经被销毁
}); });
} }
} else { } else {
@ -258,7 +258,7 @@ export class Widget extends OB {
if (beforeInitResult instanceof Promise) { if (beforeInitResult instanceof Promise) {
beforeInitResult.then(init).catch((e) => { beforeInitResult.then(init).catch((e) => {
_global.console && console.error(e); _global.console && console.error(e);
init(); !this.isDestroyed() && init(); // 异步render,改组件此时可能已经被销毁
}); });
} }
} else { } else {

Loading…
Cancel
Save