el-table 根据视口固定表头
<div ref="tableContainer"> <el-table :height="elTableHeight" > </el-table> </div>
data() { return { // table 高度 elTableHeight: null, } }
mounted: function () {
// 高度调整
this.$nextTick(()=> {
// 视口高度 - 距离顶部距离 - 导航高度(80)
this.elTableHeight = document.body.offsetHeight - this.$refs.tableContainer.offsetTop - 80
})
},

浙公网安备 33010602011771号