Browse Source

Table: remove highlight class after data change (#1977)

杨奕 8 years ago
parent
commit
441f4c31a9
1 changed files with 2 additions and 0 deletions
  1. 2 0
      packages/table/src/table-body.js

+ 2 - 0
packages/table/src/table-body.js

@@ -95,6 +95,8 @@ export default {
       const newRow = rows[data.indexOf(newVal)];
       if (oldRow) {
         oldRow.classList.remove('current-row');
+      } else if (rows) {
+        [].forEach.call(rows, row => row.classList.remove('current-row'));
       }
       if (newRow) {
         newRow.classList.add('current-row');