rem在小程序环境里不好用,所以需要用其他的api来获取元素的宽高。
我在这里需要用到 createSelectorQuery
uni.createSelectorQuery().in(this).select(".类名").boundingClientRect(data=>{
console.log(data.height) // 获取元素的高度
}).exec()
就这??
just that??
rem在小程序环境里不好用,所以需要用其他的api来获取元素的宽高。
我在这里需要用到 createSelectorQuery
uni.createSelectorQuery().in(this).select(".类名").boundingClientRect(data=>{
console.log(data.height) // 获取元素的高度
}).exec()
就这??
just that??