mirror of
				https://github.com/568071718/creator-collection-view
				synced 2025-11-03 21:05:28 +00:00 
			
		
		
		
	Update yx-collection-view.ts
修复set content方法中super在构建后被编译器优化指向成this导致死循环的bug
This commit is contained in:
		@@ -296,14 +296,14 @@ class _scroll_view extends ScrollView {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set content(value) {
 | 
					    set content(value) {
 | 
				
			||||||
        super.content = value;
 | 
					        Reflect.set(ScrollView.prototype, 'content', value, this);
 | 
				
			||||||
        if (value) {
 | 
					        if (value) {
 | 
				
			||||||
            value.on(NodeEventType.SIZE_CHANGED, this._calculateBoundary, this);
 | 
					            value.on(NodeEventType.SIZE_CHANGED, this._calculateBoundary, this);
 | 
				
			||||||
            value.on(NodeEventType.TRANSFORM_CHANGED, this._scaleChanged, this);
 | 
					            value.on(NodeEventType.TRANSFORM_CHANGED, this._scaleChanged, this);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
    get content() {
 | 
					    get content() {
 | 
				
			||||||
        return super.content;
 | 
					        return Reflect.get(ScrollView.prototype, 'content', this);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -930,7 +930,6 @@ export class YXCollectionView extends Component {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    reloadData() {
 | 
					    reloadData() {
 | 
				
			||||||
        if (this.node.activeInHierarchy && this.node.parent) {
 | 
					        if (this.node.activeInHierarchy && this.node.parent) {
 | 
				
			||||||
            // this.getComponent(Widget).updateAlignment?.();
 | 
					 | 
				
			||||||
            this._reloadData()
 | 
					            this._reloadData()
 | 
				
			||||||
            return
 | 
					            return
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user