问题:
Element 的组件在同时设置了表格的高度
el-table
以及合计行
height
,这导致合计行无法正常显示。
show-summary
解决方法:
根据文档提供的方法,添加 updated
生命周期,对Table重新布局后得到解决

<template>
<el-table
ref="table"
:height="500"
:data="dataSource"
show-summary
/>
</template>
<script>
export default {
data() {
return {
dataSource: []
}
},
updated() {
this.$nextTick(() => {
this.$refs.table.doLayout()
})
}
}
</script>