mirror of https://github.com/ElemeFE/element
Table: update hover effect. (#803)
parent
855d631f3f
commit
afb68c75fa
|
@ -32,6 +32,7 @@ export default {
|
||||||
<tr
|
<tr
|
||||||
on-click={ ($event) => this.handleClick($event, row) }
|
on-click={ ($event) => this.handleClick($event, row) }
|
||||||
on-mouseenter={ _ => this.handleMouseEnter($index) }
|
on-mouseenter={ _ => this.handleMouseEnter($index) }
|
||||||
|
on-mouseleave={ _ => this.handleMouseLeave() }
|
||||||
class={ this.getRowClass(row, $index) }>
|
class={ this.getRowClass(row, $index) }>
|
||||||
{
|
{
|
||||||
this._l(this.columns, (column, cellIndex) =>
|
this._l(this.columns, (column, cellIndex) =>
|
||||||
|
@ -145,6 +146,10 @@ export default {
|
||||||
this.store.commit('setHoverRow', index);
|
this.store.commit('setHoverRow', index);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
handleMouseLeave() {
|
||||||
|
this.store.commit('setHoverRow', null);
|
||||||
|
},
|
||||||
|
|
||||||
handleClick(event, row) {
|
handleClick(event, row) {
|
||||||
const table = this.$parent;
|
const table = this.$parent;
|
||||||
const cell = getCell(event);
|
const cell = getCell(event);
|
||||||
|
|
|
@ -322,8 +322,12 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@e body {
|
@e body {
|
||||||
tr {
|
td {
|
||||||
transition: background-color .25s ease-in-out;
|
transition: background-color .25s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
tr.hover-row td {
|
||||||
|
background-color: #eff2f7;
|
||||||
}
|
}
|
||||||
|
|
||||||
tr.current-row {
|
tr.current-row {
|
||||||
|
@ -359,7 +363,3 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.el-table .el-table__body tr.hover-row {
|
|
||||||
background-color: #eff2f7;
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in New Issue