update Table summary when fixed

This commit is contained in:
梁灏 2019-09-20 20:40:56 +08:00
parent 0b183ebba2
commit 07bde2f56d
2 changed files with 18 additions and 14 deletions

View file

@ -1,18 +1,20 @@
<template> <template>
<table class="ivu-table-summary" cellspacing="0" cellpadding="0" border="0" :style="styleObject"> <div style="overflow:hidden;">
<colgroup> <table class="ivu-table-summary" cellspacing="0" cellpadding="0" border="0" :style="styleObject">
<col v-for="(column, index) in columns" :width="setCellWidth(column)"> <colgroup>
</colgroup> <col v-for="(column, index) in columns" :width="setCellWidth(column)">
<tbody :class="[prefixCls + '-tbody']"> </colgroup>
<tr class="ivu-table-row"> <tbody :class="[prefixCls + '-tbody']">
<td v-for="(column, index) in columns" :class="alignCls(column)"> <tr class="ivu-table-row">
<div class="ivu-table-cell" :class="cellCls(column)"> <td v-for="(column, index) in columns" :class="alignCls(column)">
<span>{{ data[column.key].value }}</span> <div class="ivu-table-cell" :class="cellCls(column)">
</div> <span>{{ data[column.key].value }}</span>
</td> </div>
</tr> </td>
</tbody> </tr>
</table> </tbody>
</table>
</div>
</template> </template>
<script> <script>
import Mixin from './mixin'; import Mixin from './mixin';

View file

@ -27,6 +27,7 @@
</div> </div>
<table-summary <table-summary
v-if="showSummary && (data && data.length)" v-if="showSummary && (data && data.length)"
ref="summary"
:prefix-cls="prefixCls" :prefix-cls="prefixCls"
:styleObject="tableStyle" :styleObject="tableStyle"
:columns="cloneColumns" :columns="cloneColumns"
@ -769,6 +770,7 @@
if (this.showHeader) this.$refs.header.scrollLeft = event.target.scrollLeft; if (this.showHeader) this.$refs.header.scrollLeft = event.target.scrollLeft;
if (this.isLeftFixed) this.$refs.fixedBody.scrollTop = event.target.scrollTop; if (this.isLeftFixed) this.$refs.fixedBody.scrollTop = event.target.scrollTop;
if (this.isRightFixed) this.$refs.fixedRightBody.scrollTop = event.target.scrollTop; if (this.isRightFixed) this.$refs.fixedRightBody.scrollTop = event.target.scrollTop;
if (this.showSummary) this.$refs.summary.$el.scrollLeft = event.target.scrollLeft;
this.hideColumnFilter(); this.hideColumnFilter();
}, },
handleFixedMousewheel(event) { handleFixedMousewheel(event) {