Browse Source

Table: fix trigger double selectionchange

qingwei.li 9 năm trước cách đây
mục cha
commit
9743c8b4a3
2 tập tin đã thay đổi với 3 bổ sung3 xóa
  1. 0 1
      packages/table/src/table-body.js
  2. 3 2
      packages/table/src/table.vue

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

@@ -131,7 +131,6 @@ export default {
 
       if (grid.selectionMode === 'single') {
         grid.selected = row;
-        grid.$emit('selectionchange', row);
       }
 
       grid.$emit('rowclick', row, event);

+ 3 - 2
packages/table/src/table.vue

@@ -251,8 +251,9 @@
           gridWrapper.style.height = bodyHeight + 'px';
 
           this.$el.style.height = height + 'px';
-          this.$refs.fixed.style.height = height + 'px';
-
+          if (this.$refs.fixed) {
+            this.$refs.fixed.style.height = height + 'px';
+          }
           const fixedBodyWrapper = this.$el.querySelector('.el-table__fixed-body-wrapper');
           if (fixedBodyWrapper) {
             fixedBodyWrapper.style.height = (this.showHScrollBar ? gridWrapper.offsetHeight - this.currentGutterWidth : gridWrapper.offsetHeight) + 'px';