Taro.onWindowResize(callback)
Listens on the window size change event.
Type
(callback: Callback) => void
Parameters
Callback
The callback function for the window size change event.
(result: CallbackResult) => void
Property | Type |
---|---|
result | CallbackResult |
CallbackResult
Property | Type |
---|---|
size | Size |
Size
Property | Type | Description |
---|---|---|
windowHeight | number | New window width (in px) |
windowWidth | number | New window height (in px) |
API Support
API | WeChat Mini-Program | H5 | React Native |
---|---|---|---|
Taro.onWindowResize | ✔️ | ✔️ | ✔️ |