1、在<el-table>中添加以下的代码
:height="screenHeight < 350 ? 100 : screenHeight - 250"
2、在data中定义
data() {
return {
screenHeight: document.body.clientHeight,
}
}
3、在mounted
mounted() {
const that = this
window.onresize = () => {
return (() => {
window.screenHeight = document.body.clientHeight
that.screenHeight = window.screenHeight
})()
}
},