<el-table :data="tableData" style="width: 100%" :height="tableHeight"> <el-table-column prop="date" label="日期" width="180"> </el-table-column> </el-table>
created() { // 100是表格外其它布局占的高度,这个数值根据自己实际情况修改 this.tableHeight = window.innerHeight - 100 } mounted() { // 设置表格高度 this.tableHeight = window.innerHeight - 100 // / 监听浏览器窗口变化,动态计算表格高度, window.onresize = () => { return (() => { this.tableHeight = window.innerHeight - 100 })() } }
标签:el,tableHeight,高度,innerHeight,表头,window,table,100 From: https://www.cnblogs.com/dianzan/p/18075574