Skip to content

Commit

Permalink
Table: update getRowClass (#11839)
Browse files Browse the repository at this point in the history
* Table: setCurrentRow only when highlight-current-row is true

* Table: trigger current-change

* Table: update getRowClass
  • Loading branch information
Leopoldthecoder authored and jikkai committed Jul 3, 2018
1 parent ef74ee0 commit 61756c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/table/src/table-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,10 +267,10 @@ export default {
},

getRowClass(row, rowIndex) {
const currentRow = this.store.states.currentRow;
const classes = this.table.highlightCurrentRow && currentRow === row
? ['el-table__row', 'current-row']
: ['el-table__row'];
const classes = ['el-table__row'];
if (this.table.highlightCurrentRow && row === this.store.states.currentRow) {
classes.push('current-row');
}

if (this.stripe && rowIndex % 2 === 1) {
classes.push('el-table__row--striped');
Expand Down

0 comments on commit 61756c5

Please sign in to comment.