Skip to content

Commit 2161231

Browse files
committed
增加移动端vol-table列表显示时formatter与click方法
1 parent 03b0282 commit 2161231

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

vol.uniapp/components/vol-table/vol-table.vue

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,10 @@
9494
<view class="cell-left"> {{column.title}}</view>
9595
<view class="cell-right">
9696
<view @click.stop="cellClick(rowindex,row,column)" v-if="column.click">
97-
{{row[column.field]}}
97+
<view :style="column.style" v-if="column.formatter">
98+
<rich-text :nodes="rowFormatter(row,column,rowindex)+''"></rich-text>
99+
</view>
100+
<view :style="column.style" v-else>{{row[column.field]}}</view>
98101
</view>
99102
<view v-else-if="column.formatter">
100103
<rich-text :nodes="rowFormatter(row,column)+''"></rich-text>
@@ -410,8 +413,8 @@
410413
});
411414
},
412415
initSummary() {
413-
if(this.summary.length){
414-
this.hasSummary =true;
416+
if (this.summary.length) {
417+
this.hasSummary = true;
415418
return;
416419
}
417420
this.summary = this.columns.filter(x => {
@@ -433,7 +436,9 @@
433436
if (this.lastHeight > 0 && this.lastHeight == this.tableHeight) {
434437
return;
435438
}
436-
this.tableHeight = this.tableHeight - (res[0]||{height:0}).height;
439+
this.tableHeight = this.tableHeight - (res[0] || {
440+
height: 0
441+
}).height;
437442
this.lastHeight = this.tableHeight;
438443
})
439444
}

0 commit comments

Comments
 (0)