This API is used via wx.onWindowResize(function listener).
Attribute | Type |
size | Object |
Structure attributes | Type | Description |
windowWidth | number | The changed window width, measured in pixels. |
windowHeight | number | The changed window height, measured in pixels (px). |
This API is used via wx.offWindowResize(function listener).
const listener = function (res) { console.log(res) }wx.onWindowResize(listener)wx.offWindowResize(listener) // The same function object as the listener must be passed in.
Was this page helpful?