<template>
<el-form ref="searchFormRef"></el-form>
<el-table :max-height="maxHeight"></el-table>
</template>
<script>
import { defineComponent, onMounted, reactive, ref } from 'vue'
export default defineComponent({
setup() {
const state = reactive({
maxHeight: '760px'
})
const refs = {
searchFormRef: ref(null)
}
onMounted(() => {
methods.getTableHeight()
window.onresize = () => {
methods.getTableHeight()
}
})
const methods = {
getTableHeight: () => {
let pageHeight = document.body.offsetHeight
let formHeight = refs.searchFormRef.value.$el.clientHeight
state.maxHeight = pageHeight - 159 - formHeight + 'px'
}
}
}
})
</script>