mirror of
https://github.com/fantastic-admin/basic.git
synced 2026-10-07 09:43:17 +08:00
修复因 el-table dom结构调整导致 TableHeightAdaption 组件失效
This commit is contained in:
@@ -9,6 +9,7 @@ onMounted(() => {
|
||||
nextTick(() => {
|
||||
// 获取表头高度,然后设置 .el-table__body-wrapper 和 .el-table__fixed-body-wrapper 的 height
|
||||
let height = document.getElementsByClassName('el-table__header-wrapper')[0].offsetHeight
|
||||
document.getElementsByClassName('el-table__inner-wrapper')[0].style.height = '100%'
|
||||
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)`
|
||||
@@ -20,7 +21,7 @@ onMounted(() => {
|
||||
<style lang="scss" scoped>
|
||||
.adaption-container {
|
||||
height: 100%;
|
||||
overflow: auto;
|
||||
overflow-y: auto;
|
||||
:deep(.el-table) {
|
||||
height: 100%;
|
||||
.el-table__body-wrapper {
|
||||
|
||||
Reference in New Issue
Block a user