fix resize需要call this

This commit is contained in:
wkj 2024-06-27 16:40:19 +08:00
parent c9d43f741f
commit 4b141fb2e5
6 changed files with 6 additions and 6 deletions

View File

@ -13,7 +13,7 @@ export function createComponent(option, features) {
},
};
const { resize } = this.oakOption.lifetimes || {};
resize && resize(resizeOption);
resize && resize.call(this, resizeOption);
}
registerResize() {
this.dimensionsSubscription = Dimensions.addEventListener('change', this.handleResize.bind(this));

View File

@ -22,7 +22,7 @@ export function createComponent(option, features) {
},
};
const { resize } = this.oakOption.lifetimes || {};
resize && resize(resizeOption);
resize && resize.call(this, resizeOption);
}
registerResize() {
window.addEventListener('resize', this.handleResize);

View File

@ -17,7 +17,7 @@ function createComponent(option, features) {
},
};
const { resize } = this.oakOption.lifetimes || {};
resize && resize(resizeOption);
resize && resize.call(this, resizeOption);
}
registerResize() {
this.dimensionsSubscription = react_native_1.Dimensions.addEventListener('change', this.handleResize.bind(this));

View File

@ -26,7 +26,7 @@ function createComponent(option, features) {
},
};
const { resize } = this.oakOption.lifetimes || {};
resize && resize(resizeOption);
resize && resize.call(this, resizeOption);
}
registerResize() {
window.addEventListener('resize', this.handleResize);

View File

@ -63,7 +63,7 @@ export function createComponent<
},
};
const { resize } = this.oakOption.lifetimes || {};
resize && resize(resizeOption);
resize && resize.call(this, resizeOption);
}
private registerResize() {

View File

@ -66,7 +66,7 @@ export function createComponent<
},
};
const { resize } = this.oakOption.lifetimes || {};
resize && resize(resizeOption);
resize && resize.call(this, resizeOption);
}
private registerResize() {