feat: 表格高度自适应

This commit is contained in:
2025-07-31 20:43:03 +08:00
parent b8a5fe4157
commit 27e8366c39
2 changed files with 14 additions and 4 deletions
@@ -9,8 +9,8 @@
fit fit
:data="crud.dataSource" :data="crud.dataSource"
style="width: 100%;" style="width: 100%;"
height="450" :height="height"
max-height="450" :max-height="height"
@selection-change="onTableSelectionChange" @selection-change="onTableSelectionChange"
> >
<el-table-column v-if="mode === 'multi'" type="selection" width="55" /> <el-table-column v-if="mode === 'multi'" type="selection" width="55" />
@@ -117,6 +117,11 @@ export default {
} }
} }
}, },
computed: {
height() {
return document.documentElement.clientHeight - 250
}
},
mounted() { mounted() {
this.initData() this.initData()
}, },
@@ -9,8 +9,8 @@
fit fit
:data="crud.dataSource" :data="crud.dataSource"
style="width: 100%;" style="width: 100%;"
height="450" :height="height"
max-height="450" :max-height="height"
@selection-change="onTableSelectionChange" @selection-change="onTableSelectionChange"
> >
<el-table-column v-if="mode === 'multi'" type="selection" width="55" /> <el-table-column v-if="mode === 'multi'" type="selection" width="55" />
@@ -116,6 +116,11 @@ export default {
} }
} }
}, },
computed: {
height() {
return document.documentElement.clientHeight - 250
}
},
mounted() { mounted() {
this.initData() this.initData()
}, },