1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
| <template>
| <div style="overflow:hidden;">
| <table class="ivu-table-summary" cellspacing="0" cellpadding="0" border="0" :style="styleObject">
| <colgroup>
| <col v-for="(column, index) in columns" :width="setCellWidth(column)">
| </colgroup>
| <tbody :class="[prefixCls + '-tbody']">
| <tr class="ivu-table-row">
| <td v-for="(column, index) in columns" :class="alignCls(column)">
| <div class="ivu-table-cell" :class="cellCls(column)">
| <span>{{ data[column.key].value }}</span>
| </div>
| </td>
| </tr>
| </tbody>
| </table>
| </div>
| </template>
| <script>
| import Mixin from './mixin';
|
| export default {
| name: 'TableSummary',
| mixins: [ Mixin ],
| props: {
| prefixCls: String,
| styleObject: Object,
| columns: Array,
| data: Object, // rebuildData
| columnsWidth: Object,
| fixed: {
| type: [Boolean, String],
| default: false
| },
| },
| methods: {
| cellCls (column) {
| return [
| {
| ['ivu-table-hidden']: (this.fixed === 'left' && column.fixed !== 'left') || (this.fixed === 'right' && column.fixed !== 'right') || (!this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right'))
| }
| ];
| }
| }
| };
| </script>
|
|