问题:设置了表格最大高度之后,到超出最大高度,show-summary(合计行)就无法显示了。
解决办法:添加updated生命周期,对table重新布局。
代码:
<template>
<el-card>
<ele-pro-table
ref="table"
max-height="600"
:header-cell-style="{ textAlign: 'center' }"
:summary-method="getSummaries"
show-summary
>
</ele-pro-table>
</el-card>
</template>
<script>
export default {
data() {
return {};
},
updated() {
this.$nextTick(() => {
this.$refs.table.doLayout();
});
},
methods: {
getSummaries() {}
}
};
</script>
<style></style>