|
14 | 14 | <th v-if="selection && data.length" width="1em" key="th-multi">
|
15 | 15 | <multi-select :selection="selection" :rows="data" />
|
16 | 16 | </th>
|
17 |
| - <th v-for="(column, idx) in columns$" :key="column.title || column.field || idx" |
18 |
| - :class="column.thClass" :style="column.thStyle"> |
| 17 | + <th v-for="(column, idx) in columns$" |
| 18 | + :key="column.title || column.field || idx" |
| 19 | + :class="[column.colClass, column.thClass]" |
| 20 | + :style="[column.colStyle, column.thStyle]"> |
19 | 21 | <!-- table head component (thComp). `v-bind` here is just like spread operator in JSX -->
|
20 | 22 | <component v-if="column.thComp" :is="comp[column.thComp]" v-bind="$props"
|
21 | 23 | :column="column" :field="column.field" :title="column.title">
|
|
36 | 38 | <td v-if="selection" width="1em">
|
37 | 39 | <multi-select :selection="selection" :row="item" />
|
38 | 40 | </td>
|
39 |
| - <td v-for="column in columns$" :class="column.tdClass" :style="column.tdStyle"> |
| 41 | + <td v-for="column in columns$" |
| 42 | + :class="[column.colClass, column.tdClass]" |
| 43 | + :style="[column.colStyle, column.tdStyle]"> |
40 | 44 | <!-- table body component (tdComp) -->
|
41 | 45 | <component v-if="column.tdComp" :is="comp[column.tdComp]" v-bind="$props"
|
42 | 46 | :row="item" :field="column.field" :value="item[column.field]" :nested="item.__nested__">
|
|
61 | 65 | <td v-if="selection" width="1em"></td>
|
62 | 66 | <template v-for="(column, idx) in columns$">
|
63 | 67 | <!-- display the available fields only -->
|
64 |
| - <td v-if="summary[column.field]" :class="column.tdClass" :style="column.tdStyle"> |
| 68 | + <td v-if="summary[column.field]" |
| 69 | + :class="[column.colClass, column.tdClass]" |
| 70 | + :style="[column.colStyle, column.tdStyle]"> |
65 | 71 | <!-- table body component (tdComp) -->
|
66 | 72 | <component v-if="column.tdComp" :is="comp[column.tdComp]" v-bind="$props"
|
67 | 73 | :row="summary" :field="column.field" :value="summary[column.field]">
|
@@ -148,7 +154,7 @@ export default {
|
148 | 154 | // return columns$.map(col => ((col.weight = col.weight || 0), col)).sort((a, b) => b.weight - a.weight)
|
149 | 155 | },
|
150 | 156 | colspan () {
|
151 |
| - return this.columns$.length + (+!!this.selection) |
| 157 | + return this.columns$.length + !!this.selection |
152 | 158 | },
|
153 | 159 | data$ () {
|
154 | 160 | const { data, supportNested } = this
|
|
0 commit comments