Table columns add className

Table columns add className
This commit is contained in:
梁灏 2017-01-10 16:33:44 +08:00
parent 1b7aefeab2
commit f9f1865ca5
6 changed files with 72 additions and 393 deletions

View file

@ -1,8 +1,9 @@
export default {
methods: {
alignCls (column) {
alignCls (column, type) {
return [
{
[`${column.className}`]: column.className && type === 'body',
[`${this.prefixCls}-column-${column.align}`]: column.align,
[`${this.prefixCls}-hidden`]: (this.fixed === 'left' && column.fixed !== 'left') || (this.fixed === 'right' && column.fixed !== 'right') || (!this.fixed && column.fixed && (column.fixed === 'left' || column.fixed === 'right'))
}

View file

@ -11,7 +11,7 @@
@mouseleave.stop="handleMouseOut(row._index)"
@click.stop="clickCurrentRow(row._index)"
@dblclick.stop="dblclickCurrentRow(row._index)">
<td v-for="column in columns" :class="alignCls(column)">
<td v-for="column in columns" :class="alignCls(column, 'body')">
<Cell
:fixed="fixed"
:prefix-cls="prefixCls"

View file

@ -5,7 +5,7 @@
</colgroup>
<thead>
<tr>
<th v-for="(index, column) in columns" :class="alignCls(column)">
<th v-for="(index, column) in columns" :class="alignCls(column, 'head')">
<div :class="cellClasses(column)">
<template v-if="column.type === 'selection'"><Checkbox :checked="isSelectAll" @on-change="selectAll"></Checkbox></template>
<template v-else>