From 182a250c4f5a965a20616c6ac96cb68ef62d507b Mon Sep 17 00:00:00 2001 From: jian Date: Tue, 19 Dec 2023 16:40:41 +0800 Subject: [PATCH 1/3] =?UTF-8?q?KERNEL-16950=20fix:=20=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/4.widget.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/fineui/src/core/4.widget.js b/packages/fineui/src/core/4.widget.js index df12ef774..8fe60098a 100644 --- a/packages/fineui/src/core/4.widget.js +++ b/packages/fineui/src/core/4.widget.js @@ -240,8 +240,11 @@ export class Widget extends OB { ).call(this, render); if (beforeRenderResult instanceof Promise) { beforeRenderResult.then(render).catch((e) => { - _global.console && console.error(e); - !this.isDestroyed() && render(); // 异步render,改组件此时可能已经被销毁 + if (!this.isDestroyed()) { + render(); // 异步render,组件此时可能已经被销毁 + } else { + _global.console && console.error(e, 'Async render error! Widget has been destroyed!'); + } }); } } else { @@ -257,8 +260,11 @@ export class Widget extends OB { ).call(this, init); if (beforeInitResult instanceof Promise) { beforeInitResult.then(init).catch((e) => { - _global.console && console.error(e); - !this.isDestroyed() && init(); // 异步render,改组件此时可能已经被销毁 + if (!this.isDestroyed()) { + init(); // 异步init,组件此时可能已经被销毁 + } else { + _global.console && console.error(e, 'Async init error! Widget has been destroyed!'); + } }); } } else { @@ -874,7 +880,7 @@ export class Widget extends OB { this._assetMounted(); this.__destroy(); this.fireEvent(Events.UNMOUNT); - // this._purgeRef(); // 子组件unmount ref置为null了,父组件拿不到ref,导致报错 + this._purgeRef(); // 子组件unmount ref置为null了,父组件拿不到ref,导致报错 this.purgeListeners(); } From 9a2f3fd2e3f9c324a1ee1296707dab5942811d2c Mon Sep 17 00:00:00 2001 From: jian Date: Tue, 19 Dec 2023 16:45:16 +0800 Subject: [PATCH 2/3] =?UTF-8?q?KERNEL-16950=20fix:=20=E5=8A=A0=E4=B8=80?= =?UTF-8?q?=E4=BA=9Blog?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/4.widget.js | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/packages/fineui/src/core/4.widget.js b/packages/fineui/src/core/4.widget.js index 8fe60098a..9bf69e4a3 100644 --- a/packages/fineui/src/core/4.widget.js +++ b/packages/fineui/src/core/4.widget.js @@ -240,11 +240,9 @@ export class Widget extends OB { ).call(this, render); if (beforeRenderResult instanceof Promise) { beforeRenderResult.then(render).catch((e) => { - if (!this.isDestroyed()) { - render(); // 异步render,组件此时可能已经被销毁 - } else { - _global.console && console.error(e, 'Async render error! Widget has been destroyed!'); - } + _global.console && console.error(e); + // 异步render,组件此时可能已经被销毁 + !this.isDestroyed() ? render() : _global.console && console.error('Async render error! Widget has been destroyed!'); }); } } else { @@ -260,11 +258,9 @@ export class Widget extends OB { ).call(this, init); if (beforeInitResult instanceof Promise) { beforeInitResult.then(init).catch((e) => { - if (!this.isDestroyed()) { - init(); // 异步init,组件此时可能已经被销毁 - } else { - _global.console && console.error(e, 'Async init error! Widget has been destroyed!'); - } + _global.console && console.error(e); + // 异步init,组件此时可能已经被销毁 + !this.isDestroyed() ? init() : _global.console && console.error('Async init error! Widget has been destroyed!'); }); } } else { From 876ab205441f1db42fe25b3d2d5ffac2968cee3d Mon Sep 17 00:00:00 2001 From: jian Date: Wed, 20 Dec 2023 08:59:22 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=97=A0jira=E4=BB=BB=E5=8A=A1=20=E5=A4=9A?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/4.widget.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fineui/src/core/4.widget.js b/packages/fineui/src/core/4.widget.js index 9bf69e4a3..7ddf3b320 100644 --- a/packages/fineui/src/core/4.widget.js +++ b/packages/fineui/src/core/4.widget.js @@ -876,7 +876,7 @@ export class Widget extends OB { this._assetMounted(); this.__destroy(); this.fireEvent(Events.UNMOUNT); - this._purgeRef(); // 子组件unmount ref置为null了,父组件拿不到ref,导致报错 + // this._purgeRef(); // 子组件unmount ref置为null了,父组件拿不到ref,导致报错 this.purgeListeners(); }