在ios上,fixed定位因为input导致手机下面出现空白,视图变小

<div class="btnBox" v-show="isOriginHei">
    <div class="btn" >提交</div>
</div>

vue项目项目中在mountd里面获取视图的高度

mounted() {
       const that = this
     window.onresize = () => {
                return (() => {
            window.screenHeight= document.body.clientHeight
                  that.screenHeight= window.screenHeight
            })()
}

},

watch: {
screenHeight(val) {
this.screenHeight= val
if(this.originHeight != val) {
this.isOriginHei = false;
}else{
this.isOriginHei = true;
}
},

}

猜你喜欢

转载自www.cnblogs.com/carrie5/p/10298269.html