mirror of https://github.com/ElemeFE/element
Table: support class-name when type=expand (#12006)
parent
4167809446
commit
ef4caa96cb
|
@ -58,55 +58,30 @@ export default {
|
||||||
if (!rowspan || !colspan) {
|
if (!rowspan || !colspan) {
|
||||||
return '';
|
return '';
|
||||||
} else {
|
} else {
|
||||||
if (rowspan === 1 && colspan === 1) {
|
return (
|
||||||
return (
|
<td
|
||||||
<td
|
style={ this.getCellStyle($index, cellIndex, row, column) }
|
||||||
style={ this.getCellStyle($index, cellIndex, row, column) }
|
class={ this.getCellClass($index, cellIndex, row, column) }
|
||||||
class={ this.getCellClass($index, cellIndex, row, column) }
|
rowspan={ rowspan }
|
||||||
on-mouseenter={ ($event) => this.handleCellMouseEnter($event, row) }
|
colspan={ colspan }
|
||||||
on-mouseleave={ this.handleCellMouseLeave }>
|
on-mouseenter={ ($event) => this.handleCellMouseEnter($event, row) }
|
||||||
{
|
on-mouseleave={ this.handleCellMouseLeave }>
|
||||||
column.renderCell.call(
|
{
|
||||||
this._renderProxy,
|
column.renderCell.call(
|
||||||
h,
|
this._renderProxy,
|
||||||
{
|
h,
|
||||||
row,
|
{
|
||||||
column,
|
row,
|
||||||
$index,
|
column,
|
||||||
store: this.store,
|
$index,
|
||||||
_self: this.context || this.table.$vnode.context
|
store: this.store,
|
||||||
},
|
_self: this.context || this.table.$vnode.context
|
||||||
columnsHidden[cellIndex]
|
},
|
||||||
)
|
columnsHidden[cellIndex]
|
||||||
}
|
)
|
||||||
</td>
|
}
|
||||||
);
|
</td>
|
||||||
} else {
|
);
|
||||||
return (
|
|
||||||
<td
|
|
||||||
style={ this.getCellStyle($index, cellIndex, row, column) }
|
|
||||||
class={ this.getCellClass($index, cellIndex, row, column) }
|
|
||||||
rowspan={ rowspan }
|
|
||||||
colspan={ colspan }
|
|
||||||
on-mouseenter={ ($event) => this.handleCellMouseEnter($event, row) }
|
|
||||||
on-mouseleave={ this.handleCellMouseLeave }>
|
|
||||||
{
|
|
||||||
column.renderCell.call(
|
|
||||||
this._renderProxy,
|
|
||||||
h,
|
|
||||||
{
|
|
||||||
row,
|
|
||||||
column,
|
|
||||||
$index,
|
|
||||||
store: this.store,
|
|
||||||
_self: this.context || this.table.$vnode.context
|
|
||||||
},
|
|
||||||
columnsHidden[cellIndex]
|
|
||||||
)
|
|
||||||
}
|
|
||||||
</td>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -279,7 +279,17 @@ export default {
|
||||||
sortOrders: this.sortOrders
|
sortOrders: this.sortOrders
|
||||||
});
|
});
|
||||||
|
|
||||||
objectAssign(column, forced[type] || {});
|
let source = forced[type] || {};
|
||||||
|
for (let prop in source) {
|
||||||
|
if (source.hasOwnProperty(prop)) {
|
||||||
|
let value = source[prop];
|
||||||
|
if (value !== undefined) {
|
||||||
|
column[prop] = prop === 'className'
|
||||||
|
? `${column[prop]} ${value}`
|
||||||
|
: value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.columnConfig = column;
|
this.columnConfig = column;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue