一、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>

 

相关文章:

  • 2022-01-07
  • 2022-01-08
  • 2021-06-15
猜你喜欢
  • 2022-01-08
  • 2021-11-18
  • 2022-01-07
  • 2022-01-08
  • 2022-12-23
相关资源
相似解决方案