May 19, 2021 WeChat Mini Program Development Document
Base Library 2.10.1 starts to be supported, and low versions need to be compatible.
Starting with the base library 2.11.0, this interface stops maintenance
Set the window size, this interface is only available for PC platforms, see the guide for usage rules
Property | Type | The default | Required | Description |
---|---|---|---|---|
width | number | Is | Window width, in pixels | |
height | number | Is | Window height, in pixels | |
success | function | Whether | The interface calls a successful callback function | |
fail | function | Whether | The interface calls the failed callback function | |
complete | function | Whether | Callback function at end of interface call (call succeeds, fails are executed) |
The base library 2.3.0 starts to support, and the lower version needs to be compatible.
Listen for window size change events
The callback function for window size change events
Property | Type | Description |
---|---|---|
size | Object |
The structure of size
Property | Type | Description |
---|---|---|
windowWidth | number | Changed window width in px |
windowHeight | number | Changed window height in px |
The base library 2.3.0 starts to support, and the lower version needs to be compatible.
Cancel listening for window size change events
The callback function for window size change events