From 22254aebb37fc122851aa1e1170e9e3c3b4a0206 Mon Sep 17 00:00:00 2001 From: jian Date: Fri, 15 Dec 2023 17:54:53 +0800 Subject: [PATCH] =?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(); } }