問題:
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>