Przeglądaj źródła

Table: fix table header height after filter (#17348)

hetech 6 lat temu
rodzic
commit
90c5d74fd3

+ 1 - 1
packages/table/src/store/current.js

@@ -51,7 +51,7 @@ export default {
     updateCurrentRowData() {
       const { states, table } = this;
       const { rowKey, _currentRowKey } = states;
-      // data 为 null 时,构时的默认值会被忽略
+      // data 为 null 时,构时的默认值会被忽略
       const data = states.data || [];
       const oldCurrentRow = states.currentRow;
 

+ 1 - 1
packages/table/src/store/watcher.js

@@ -212,7 +212,7 @@ export default Vue.extend({
     updateAllSelected() {
       const states = this.states;
       const { selection, rowKey, selectable } = states;
-      // data 为 null 时,构时的默认值会被忽略
+      // data 为 null 时,构时的默认值会被忽略
       const data = states.data || [];
       if (data.length === 0) {
         states.isAllSelected = false;

+ 1 - 1
packages/table/src/table-layout.js

@@ -111,7 +111,7 @@ class TableLayout {
     }
     this.fixedBodyHeight = this.scrollX ? (this.bodyHeight - this.gutterWidth) : this.bodyHeight;
 
-    const noData = !this.table.data || this.table.data.length === 0;
+    const noData = !(this.store.states.data && this.store.states.data.length);
     this.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
 
     this.updateScrollY();