table colStyle, cellStyle, html render

This commit is contained in:
Sebastian Frank
2017-09-01 19:28:51 +02:00
parent 1f86e58a86
commit d2cb821143
4 changed files with 53 additions and 12 deletions

View File

@@ -5,6 +5,7 @@
<div class="table_header">
<div v-for="(col, i) in columns"
:class="['table_cell', {['sortable']: col.orderBy, [`align-${col.align}`]: col.align}]"
:style="col.colStyle"
:key="i">
<!-- Column with sorting -->
@@ -29,10 +30,11 @@
<!-- Row content -->
<div v-for="(col, ci) in columns"
:class="['table_cell', {[`align-${col.align}`]: col.align}]"
:style="typeof col.cellStyle == 'function' ? col.cellStyle(row) : col.cellStyle"
:key="ci + 'c'">
<span v-if="col.prop" :title="getProp(row, col.prop)">{{ getProp(row, col.prop) }}</span>
<span v-else-if="col.render">{{ col.render(row) }}</span>
<span v-else-if="col.render" v-html="col.render(row)"></span>
</div>
<!-- Row actions -->