File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -280,16 +280,19 @@ export default {
280
280
} ) ;
281
281
282
282
let source = forced [ type ] || { } ;
283
- for ( let prop in source ) {
284
- if ( source . hasOwnProperty ( prop ) ) {
285
- let value = source [ prop ] ;
286
- if ( value !== undefined ) {
287
- column [ prop ] = prop === 'className'
288
- ? `${ column [ prop ] } ${ value } `
289
- : value ;
283
+ Object . keys ( source ) . forEach ( ( prop ) => {
284
+ let value = source [ prop ] ;
285
+ if ( value !== undefined ) {
286
+ if ( prop === 'renderHeader' ) {
287
+ if ( type === 'selection' && column [ prop ] ) {
288
+ console . warn ( '[Element Warn][TableColumn]Selection column doesn\'t allow to set render-header function.' ) ;
289
+ } else {
290
+ value = column [ prop ] || value ;
291
+ }
290
292
}
293
+ column [ prop ] = prop === 'className' ? `${ column [ prop ] } ${ value } ` : value ;
291
294
}
292
- }
295
+ } ) ;
293
296
294
297
this . columnConfig = column ;
295
298
Original file line number Diff line number Diff line change @@ -106,7 +106,8 @@ export default {
106
106
on-click = { ( $event ) => this . handleHeaderClick ( $event , column ) }
107
107
on-contextmenu = { ( $event ) => this . handleHeaderContextMenu ( $event , column ) }
108
108
style = { this . getHeaderCellStyle ( rowIndex , cellIndex , columns , column ) }
109
- class = { this . getHeaderCellClass ( rowIndex , cellIndex , columns , column ) } >
109
+ class = { this . getHeaderCellClass ( rowIndex , cellIndex , columns , column ) }
110
+ key = { column . id } >
110
111
< div class = { [ 'cell' , column . filteredValue && column . filteredValue . length > 0 ? 'highlight' : '' , column . labelClassName ] } >
111
112
{
112
113
column . renderHeader
You can’t perform that action at this time.
0 commit comments