From 8c1b4d827d69635cd0349ab974a1394e1f309fcb Mon Sep 17 00:00:00 2001 From: Jikkai Xiao Date: Mon, 4 Jun 2018 11:34:37 +0800 Subject: [PATCH] Table: retain currently selected row when expanding row (#11464) --- packages/table/src/table-body.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/table/src/table-body.js b/packages/table/src/table-body.js index b2e93bca3..8510bf66c 100644 --- a/packages/table/src/table-body.js +++ b/packages/table/src/table-body.js @@ -267,7 +267,8 @@ export default { }, getRowClass(row, rowIndex) { - const classes = ['el-table__row']; + const currentRow = this.store.states.currentRow; + const classes = currentRow === row ? ['el-table__row', 'current-row'] : ['el-table__row']; if (this.stripe && rowIndex % 2 === 1) { classes.push('el-table__row--striped');