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