Explorar el Código

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

杨奕 hace 8 años
padre
commit
441f4c31a9
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  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');