mirror of
https://github.com/568071718/creator-collection-view
synced 2025-05-31 21:54:01 +00:00
Update yx-collection-view.ts
修复set content方法中super在构建后被编译器优化指向成this导致死循环的bug
This commit is contained in:
parent
e3cb12d571
commit
cdefb153bb
@ -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
|
||||||
}
|
}
|
||||||
@ -1529,4 +1528,4 @@ export abstract class YXBinaryLayout extends YXLayout {
|
|||||||
|
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user