From 22254aebb37fc122851aa1e1170e9e3c3b4a0206 Mon Sep 17 00:00:00 2001 From: jian Date: Fri, 15 Dec 2023 17:54:53 +0800 Subject: [PATCH 1/3] =?UTF-8?q?KERNEL-16950=20fix:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/platform/web/detectElementResize.js | 4 ++++ packages/fineui/src/fix/fix.js | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/fineui/src/core/platform/web/detectElementResize.js b/packages/fineui/src/core/platform/web/detectElementResize.js index 3ae28a853..47e360114 100644 --- a/packages/fineui/src/core/platform/web/detectElementResize.js +++ b/packages/fineui/src/core/platform/web/detectElementResize.js @@ -46,10 +46,14 @@ export const ResizeDetector = { addResizeListener(widget.element[0], fn); return function () { + // 如果fn是debounce需要cancel掉 + fn?.cancel?.(); removeResizeListener(widget.element[0], fn); }; }, removeResizeListener(widget, fn) { + // 如果fn是debounce需要cancel掉 + fn?.cancel?.(); removeResizeListener(widget.element[0], fn); }, }; diff --git a/packages/fineui/src/fix/fix.js b/packages/fineui/src/fix/fix.js index c2f0ddd12..387eb3984 100644 --- a/packages/fineui/src/fix/fix.js +++ b/packages/fineui/src/fix/fix.js @@ -1386,7 +1386,7 @@ class Model { this.$$computed = null; this.$$state = null; this.$$context = null; - this.model = null; + this.model = {}; // 一些异步请求里访问model里的属性,这里先变成空对象,保证部分场景下不报错,其他报错会try catch this._destroyHandler && this._destroyHandler(); } } From c6d10e42d14d5b67c865cf44a0df8bf7e5054103 Mon Sep 17 00:00:00 2001 From: jian Date: Sun, 17 Dec 2023 22:04:49 +0800 Subject: [PATCH 2/3] =?UTF-8?q?KERNEL-16950=20fix:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/fineui/src/core/4.widget.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fineui/src/core/4.widget.js b/packages/fineui/src/core/4.widget.js index c8fbe5d2f..df12ef774 100644 --- a/packages/fineui/src/core/4.widget.js +++ b/packages/fineui/src/core/4.widget.js @@ -241,7 +241,7 @@ export class Widget extends OB { if (beforeRenderResult instanceof Promise) { beforeRenderResult.then(render).catch((e) => { _global.console && console.error(e); - render(); + !this.isDestroyed() && render(); // 异步render,改组件此时可能已经被销毁 }); } } else { @@ -258,7 +258,7 @@ export class Widget extends OB { if (beforeInitResult instanceof Promise) { beforeInitResult.then(init).catch((e) => { _global.console && console.error(e); - init(); + !this.isDestroyed() && init(); // 异步render,改组件此时可能已经被销毁 }); } } else { From 4b443685e985c951eb76853a2e80b855863be745 Mon Sep 17 00:00:00 2001 From: jian Date: Tue, 19 Dec 2023 14:18:47 +0800 Subject: [PATCH 3/3] KERNEL-16950 fix: ref --- packages/fineui/src/core/wrapper/layout/layout.table.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/fineui/src/core/wrapper/layout/layout.table.js b/packages/fineui/src/core/wrapper/layout/layout.table.js index ec75bc8f0..b32f9b530 100644 --- a/packages/fineui/src/core/wrapper/layout/layout.table.js +++ b/packages/fineui/src/core/wrapper/layout/layout.table.js @@ -56,10 +56,10 @@ export class TableLayout extends Layout { "grid-column-gap": this._optimiseGap(o.hgap), }); } - + return { type: "bi.default", - ref(_ref) { + ref: (_ref) => { this.layout = _ref; }, items: this._formatItems(items), @@ -110,7 +110,7 @@ export class TableLayout extends Layout { type: "bi.layout", }), cls); } - + return first(wrapLayout(item), cls); })), []); }