瀏覽代碼

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

杨奕 8 年之前
父節點
當前提交
441f4c31a9
共有 1 個文件被更改,包括 2 次插入0 次删除
  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');