zoukankan      html  css  js  c++  java
  • js设置高度获取高度

     <div ref="content">
      <div ref="header"></div>
      <div class="tabs_panel" :style="{height: `${billingHeight}px`}" style="overflow: auto"  :class="[isEdit?'class1':'class2']"></div>
    </div>
    //document.body.clientHeight浏览器高度
    //document.body.clientWidth浏览器宽度
    //this.$refs.content.offsetHeight//DOM元素高度
       mounted() {
                this.billingHeight = this.$refs.content.$el.offsetHeight - this.$refs.header.offsetHeight
            },
     
     
     
    import Bus from '@/libs/bus.js'
     window.onresize = () => {
          return (() => {
            this.setScreenHeight(document.body.clientHeight) //获取浏览器高度
            this.setScreenWidth(document.body.clientWidth)//获取浏览器宽度
            Bus.$emit('getTableHeight')
          })()
        }
  • 相关阅读:
    H5页面富文本展示图片之间存在空隙
    如何关闭eslint语法校验
    K8S service详解
    vim添加或删除多行注释
    K8S 弹性伸缩
    Load高问题排查
    Dockerfile CMD和ENTRYPOINT
    nginx配置
    sed命令
    Pod排错指南
  • 原文地址:https://www.cnblogs.com/wssdx/p/14007154.html
Copyright © 2011-2022 走看看