Table data support to set cell className
Table data support to set cell className
This commit is contained in:
parent
f9f1865ca5
commit
c211f71778
3 changed files with 39 additions and 10 deletions
|
@ -1,9 +1,14 @@
|
|||
export default {
|
||||
methods: {
|
||||
alignCls (column, type) {
|
||||
alignCls (column, type, row = {}) {
|
||||
let cellClassName = '';
|
||||
if (row.cellClassName && column.key && row.cellClassName[column.key]) {
|
||||
cellClassName = row.cellClassName[column.key];
|
||||
}
|
||||
return [
|
||||
{
|
||||
[`${column.className}`]: column.className && type === 'body',
|
||||
[`${cellClassName}`]: cellClassName, // cell className
|
||||
[`${column.className}`]: column.className && type === 'body', // column className
|
||||
[`${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'))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue