|
|
@ -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 { |
|
|
|