<template>
<div>
<el-table :max-height="maxTabelHeight"> </el-table>
</div>
</template>
<script>
export default {
created() {
this.calcTabelHeight()
},
mounted() {
window.onresize = () => {
this.calcTabelHeight()
}
},
methods: {
calcTabelHeight() {
window.bodyHeight = document.documentElement.clienHeight || document.body.clientHeight;
this.maxTabelHeight = window.bodyHeight - 306;
},
}
}
</script>
element-ui 动态计算tabel的流体高度
最新推荐文章于 2024-09-16 17:51:15 发布