首页 > 移动平台 > 详细

uniapp动态获取高度

时间:2020-08-12 19:00:35      阅读:698      评论:0      收藏:0      [点我收藏+]
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()
				       }
				});
		},

uniapp动态获取高度

原文:https://www.cnblogs.com/cl1998/p/13492138.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!