uniapp动态获取高度
时间:2020-08-12 19:00:35
收藏:0
阅读:698
onReady(){ let that = this uni.getSystemInfo({ success: function(res) { // res - 各种参数 console.log(res.windowHeight); // 屏幕的宽度 let info = uni.createSelectorQuery().select(".hander");// 获取某个元素 info.boundingClientRect(function(data) { //data - 各种参数 console.log(data.height) // 获取元素宽度 let view = res.windowHeight - data.height that.heightHome = view }).exec() } }); },
原文:https://www.cnblogs.com/cl1998/p/13492138.html
评论(0)