1新建jssetHeight.js//用于计算页面element表格高度,动态设置表格高度exportfunctionsetHeight(){constconfigHeight=window.innerHeight-this.$refs.tableRef.$el.offsetTop-50constbody=document.getElementsByClassName('el-table__body')[0].offsetHeight常量头=document.getElementsByClassName('el-table__header')[0].offsetHeightconsttotal=body+head+2console.log('total',total)如果(configHeight<总计){this.tableHeight=configHeight>300?configHeight:300}else{this.tableHeight=total>300?total:300}//constcard=document.getElementsByClassName('base-table-card')//card[0].style.height=configHeight+50+'px'//监听窗口大小化constself=thiswindow.onresize=function(){constconfigHeight=window.innerHeight-self.$refs.tableRef.$el.offsetTop-50constbody=document.getElementsByClassName('el-table__body')[0].offsetHeightconsthead=文档。getElementsByClassName('el-table__header')[0].offsetHeightconsttotal=body+head+2console.log('total1',total)if(configHeight
