Skip to content

Commit

Permalink
Table: update hover effect. (#803)
Browse files Browse the repository at this point in the history
  • Loading branch information
furybean authored and QingWei-Li committed Nov 3, 2016
1 parent 855d631 commit afb68c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions packages/table/src/table-body.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export default {
<tr
on-click={ ($event) => this.handleClick($event, row) }
on-mouseenter={ _ => this.handleMouseEnter($index) }
on-mouseleave={ _ => this.handleMouseLeave() }
class={ this.getRowClass(row, $index) }>
{
this._l(this.columns, (column, cellIndex) =>
Expand Down Expand Up @@ -145,6 +146,10 @@ export default {
this.store.commit('setHoverRow', index);
},

handleMouseLeave() {
this.store.commit('setHoverRow', null);
},

handleClick(event, row) {
const table = this.$parent;
const cell = getCell(event);
Expand Down
12 changes: 6 additions & 6 deletions packages/theme-default/src/table.css
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,12 @@
}

@e body {
tr {
transition: background-color .25s ease-in-out;
td {
transition: background-color .25s ease;
}

tr.hover-row td {
background-color: #eff2f7;
}

tr.current-row {
Expand Down Expand Up @@ -359,7 +363,3 @@
}
}
}

.el-table .el-table__body tr.hover-row {
background-color: #eff2f7;
}

0 comments on commit afb68c7

Please sign in to comment.