UNI-APP 动态获取页面剩余高度 //scroll -view高度
需求: 动态获取设备高度,页面上部分固定,下面scrollv-view 滚动
data 中定义: windowheight:0 //页面高度;
navHeight:0, //元素的所需高度;
scrollViewHeight:0, //剩余高度;
在onShow中:
async onShow(){
await uni.getSystemInfo({
success(res){
console.log(res,‘获取设备信息’)
_self.windowHeight = res.windowHeight
原创
2020-11-30 17:18:10 ·
1675 阅读 ·
0 评论