This API is called using wx.onWindowResize(function listener).
Property | Type |
size | Object |
Property | Type | Description |
windowWidth | number | The new window width in pixels. |
windowHeight | number | The new window height in pixels. |
The API is called using wx.offWindowResize(function listener).
const listener = function (res) { console.log(res) }wx.onWindowResize(listener)wx.offWindowResize(listener) // Must pass the same function object used in wx.onWindowResize