vue+el-table 根据屏幕大小动态设置max-height属性适合适配多个表格高度出现滚动条


   
   

   
       
   

   
       
   

   
       
   

mounted:function(){
    this.tableHeight = window.innerHeight - this.$refs.table.$el.offsetTop - 50;
    //window.innerHeight:浏览器的可用高度
    //this.$refs.table.$el.offsetTop:表格距离浏览器的高度
    //后面的50:根据需求空出的高度,自行调整
}

你可能感兴趣的:(前端适配,vue)