We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
微信小程序
小程序基础库: 2.12.0 使用框架: React
useReady(() => { const query = Taro.createSelectorQuery() query.select('#header').boundingClientRect(res => { //获取导航栏高度 let { height } = res console.log(height) }).exec() })
每次打开都能获取到高度
打开之后偶尔高度为null
� Taro v3.0.2 Taro CLI 3.0.2 environment info: System: OS: Windows 7 Binaries: Node: 12.18.0 - D:\nodejs\node.EXE Yarn: 1.22.4 - C:\Users\Administrator\AppData\Roaming\npm\yarn.CMD npm: 6.14.5 - D:\nodejs\npm.CMD
The text was updated successfully, but these errors were encountered:
@vscing Taro API 只是对原生 API 做了 promise 化,你可以使用 wx. 再试试
Sorry, something went wrong.
复现不了,还有问题的话提供一下可复现 demo 吧。
No branches or pull requests
相关平台
微信小程序
小程序基础库: 2.12.0
使用框架: React
复现步骤
useReady(() => {
const query = Taro.createSelectorQuery()
query.select('#header').boundingClientRect(res => {
//获取导航栏高度
let { height } = res
console.log(height)
}).exec()
})
期望结果
每次打开都能获取到高度
实际结果
打开之后偶尔高度为null
环境信息
The text was updated successfully, but these errors were encountered: