一、css 高度设置成100vh height: 100vh;
二、动态获取
HTML
<div class="content" :style={height:vdaH}></div>
JS
<script>
export default {
name: 'login',
data() {
return {
vdaH:0,
}
},
methods: {
},
created() {
let h = document.documentElement.clientHeight || document.body.clientHeight;
this.vdaH = h - 130 + 'px';
},
};
</script>
3,css计算属性
.page_content {
height: calc(100vh - 200px);
}
网友评论