Browse Source

KERNEL-16950 fix: 加一些log

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

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

@ -240,11 +240,9 @@ export class Widget extends OB {
).call(this, render); ).call(this, render);
if (beforeRenderResult instanceof Promise) { if (beforeRenderResult instanceof Promise) {
beforeRenderResult.then(render).catch((e) => { beforeRenderResult.then(render).catch((e) => {
if (!this.isDestroyed()) { _global.console && console.error(e);
render(); // 异步render,组件此时可能已经被销毁 // 异步render,组件此时可能已经被销毁
} else { !this.isDestroyed() ? render() : _global.console && console.error('Async render error! Widget has been destroyed!');
_global.console && console.error(e, 'Async render error! Widget has been destroyed!');
}
}); });
} }
} else { } else {
@ -260,11 +258,9 @@ export class Widget extends OB {
).call(this, init); ).call(this, init);
if (beforeInitResult instanceof Promise) { if (beforeInitResult instanceof Promise) {
beforeInitResult.then(init).catch((e) => { beforeInitResult.then(init).catch((e) => {
if (!this.isDestroyed()) { _global.console && console.error(e);
init(); // 异步init,组件此时可能已经被销毁 // 异步init,组件此时可能已经被销毁
} else { !this.isDestroyed() ? init() : _global.console && console.error('Async init error! Widget has been destroyed!');
_global.console && console.error(e, 'Async init error! Widget has been destroyed!');
}
}); });
} }
} else { } else {

Loading…
Cancel
Save