提交 0f3ffe1c 编写于 作者: DCloud-WZF's avatar DCloud-WZF 💬

docs(onWindowResize): 修复示例代码错误问题

上级 cc8e1487
......@@ -18,10 +18,11 @@
**代码示例**
```javascript
uni.onWindowResize((res) => {
console.log('变化后的窗口宽度=' + res.size.windowWidth)
console.log('变化后的窗口高度=' + res.size.windowHeight)
})
const windowResizeCallback = (res) => {
console.log('变化后的窗口宽度=' + res.size.windowWidth)
console.log('变化后的窗口高度=' + res.size.windowHeight)
}
uni.onWindowResize(windowResizeCallback)
```
**TIPS**
......@@ -39,10 +40,11 @@ uni.onWindowResize((res) => {
|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
|√|√|√|x|x|x|√|
**Tips**
- `CALLBACK`为调用`uni.onWindowResize`时传入的`CALLBACK`
**代码示例**
```javascript
uni.offWindowResize(() => {
console.log('取消监听窗口尺寸变化事件')
})
uni.offWindowResize(windowResizeCallback)
```
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册