Skip to content

Commit

Permalink
Table: fix class location avoid click event errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adaex committed Aug 25, 2021
1 parent 25cb53f commit 781fc30
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/table/src/table-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export default {
},

getCellClass(rowIndex, columnIndex, row, column) {
const classes = ['el-table__cell', column.id, column.align, column.className];
const classes = [column.id, column.align, column.className];

if (this.isColumnHidden(columnIndex)) {
classes.push('is-hidden');
Expand Down Expand Up @@ -369,7 +369,7 @@ export default {
return (
<td
style={ this.getCellStyle($index, cellIndex, row, column) }
class={ this.getCellClass($index, cellIndex, row, column) }
class={ [...this.getCellClass($index, cellIndex, row, column), 'el-table__cell'] }
rowspan={ rowspan }
colspan={ colspan }
on-mouseenter={ ($event) => this.handleCellMouseEnter($event, row) }
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/table-footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default {
key={cellIndex}
colspan={ column.colSpan }
rowspan={ column.rowSpan }
class={ ['el-table__cell', ...this.getRowClasses(column, cellIndex)] }>
class={ [...this.getRowClasses(column, cellIndex), 'el-table__cell'] }>
<div class={ ['cell', column.labelClassName] }>
{
sums[cellIndex]
Expand Down
4 changes: 2 additions & 2 deletions packages/table/src/table-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default {
on-click={ ($event) => this.handleHeaderClick($event, column) }
on-contextmenu={ ($event) => this.handleHeaderContextMenu($event, column) }
style={ this.getHeaderCellStyle(rowIndex, cellIndex, columns, column) }
class={ this.getHeaderCellClass(rowIndex, cellIndex, columns, column) }
class={ [...this.getHeaderCellClass(rowIndex, cellIndex, columns, column), 'el-table__cell'] }
key={ column.id }>
<div class={ ['cell', column.filteredValue && column.filteredValue.length > 0 ? 'highlight' : '', column.labelClassName] }>
{
Expand Down Expand Up @@ -260,7 +260,7 @@ export default {
},

getHeaderCellClass(rowIndex, columnIndex, row, column) {
const classes = ['el-table__cell', column.id, column.order, column.headerAlign, column.className, column.labelClassName];
const classes = [column.id, column.order, column.headerAlign, column.className, column.labelClassName];

if (rowIndex === 0 && this.isCellHidden(columnIndex, row)) {
classes.push('is-hidden');
Expand Down

0 comments on commit 781fc30

Please sign in to comment.