uniapp动态获取高度

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()
				       }
				});
		},
posted @ 2020-08-12 17:58  飞鸟和蝉-  阅读(3516)  评论(0编辑  收藏  举报