小程序uni-app页面高度自适应 小程序坑多,还是用uni-app来写小程序好点 在页面最后加一个有id的标签 然后在js处写这个 将值赋给父元素的style上就ok 附: onReady: function () { const query = uni.createSelectorQuery().in(this); query.select('#d').boundingClientRect(data => { this.home_page_height=data.top*2; }).exec(); }