Browse Source

KERNEL-16950 fix: 优化

research/test
jian 12 months ago
parent
commit
22254aebb3
  1. 4
      packages/fineui/src/core/platform/web/detectElementResize.js
  2. 2
      packages/fineui/src/fix/fix.js

4
packages/fineui/src/core/platform/web/detectElementResize.js

@ -46,10 +46,14 @@ export const ResizeDetector = {
addResizeListener(widget.element[0], fn); addResizeListener(widget.element[0], fn);
return function () { return function () {
// 如果fn是debounce需要cancel掉
fn?.cancel?.();
removeResizeListener(widget.element[0], fn); removeResizeListener(widget.element[0], fn);
}; };
}, },
removeResizeListener(widget, fn) { removeResizeListener(widget, fn) {
// 如果fn是debounce需要cancel掉
fn?.cancel?.();
removeResizeListener(widget.element[0], fn); removeResizeListener(widget.element[0], fn);
}, },
}; };

2
packages/fineui/src/fix/fix.js

@ -1386,7 +1386,7 @@ class Model {
this.$$computed = null; this.$$computed = null;
this.$$state = null; this.$$state = null;
this.$$context = null; this.$$context = null;
this.model = null; this.model = {}; // 一些异步请求里访问model里的属性,这里先变成空对象,保证部分场景下不报错,其他报错会try catch
this._destroyHandler && this._destroyHandler(); this._destroyHandler && this._destroyHandler();
} }
} }

Loading…
Cancel
Save