uniapp获取屏幕高度

template里

<template>
  <view :style="{'height':vheight}">
  </view>
</template>

script里

  data(){
    return{		
	vheight:"",//获取的高度
    }
  },
 onReady() {
        // 计算屏幕剩余高度  填补剩余高度
        let _this = this;
        uni.getSystemInfo({
            success(res) {
                _this.vheight= res.windowHeight;
                console.log(res.windowHeight);
            }
        });
    },
posted @ 2021-08-05 13:54  seekHelp  阅读(711)  评论(0编辑  收藏  举报