其他分享
首页 > 其他分享> > uniapp获取屏幕高度

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);
            }
        });
    },

标签:剩余,uniapp,res,高度,获取,windowHeight,屏幕,vheight
来源: https://www.cnblogs.com/axingya/p/15102987.html