From cdefb153bb7038459db64c6e39c1f3afd8c3964a Mon Sep 17 00:00:00 2001 From: "Yida.Xu" <522918670@qq.com> Date: Mon, 12 May 2025 10:31:27 +0800 Subject: [PATCH] Update yx-collection-view.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复set content方法中super在构建后被编译器优化指向成this导致死循环的bug --- list-3x/assets/lib/yx-collection-view.ts | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/list-3x/assets/lib/yx-collection-view.ts b/list-3x/assets/lib/yx-collection-view.ts index dbeb222..d23bbb2 100644 --- a/list-3x/assets/lib/yx-collection-view.ts +++ b/list-3x/assets/lib/yx-collection-view.ts @@ -296,14 +296,14 @@ class _scroll_view extends ScrollView { } set content(value) { - super.content = value; + Reflect.set(ScrollView.prototype, 'content', value, this); if (value) { value.on(NodeEventType.SIZE_CHANGED, this._calculateBoundary, this); value.on(NodeEventType.TRANSFORM_CHANGED, this._scaleChanged, this); } } get content() { - return super.content; + return Reflect.get(ScrollView.prototype, 'content', this); } } @@ -930,7 +930,6 @@ export class YXCollectionView extends Component { */ reloadData() { if (this.node.activeInHierarchy && this.node.parent) { - // this.getComponent(Widget).updateAlignment?.(); this._reloadData() return } @@ -1529,4 +1528,4 @@ export abstract class YXBinaryLayout extends YXLayout { return result } -} \ No newline at end of file +}