mirror of
https://gitee.com/fantastic-admin/basic.git
synced 2024-12-09 15:38:16 +08:00
优化 TableHeightAdaption 组件
This commit is contained in:
parent
1ff85c7bea
commit
c195fd2bc2
@ -7,9 +7,12 @@
|
||||
<script setup name="TableHeightAdaption">
|
||||
onMounted(() => {
|
||||
nextTick(() => {
|
||||
// 获取表头高度,然后设置 .el-table__body-wrapper 的 height
|
||||
// 获取表头高度,然后设置 .el-table__body-wrapper 和 .el-table__fixed-body-wrapper 的 height
|
||||
let height = document.getElementsByClassName('el-table__header-wrapper')[0].offsetHeight
|
||||
document.getElementsByClassName('el-table__body-wrapper')[0].style.height = `calc(100% - ${height}px)`
|
||||
for (let item of document.getElementsByClassName('el-table__fixed-body-wrapper')) {
|
||||
item.style.height = `calc(100% - ${height}px)`
|
||||
}
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
Loading…
Reference in New Issue
Block a user