mirror of
				https://github.com/568071718/creator-collection-view
				synced 2025-11-04 05:15:29 +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) {
 | 
			
		||||
        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
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user