Commit 90c5d74f authored by hetech's avatar hetech Committed by GitHub

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

parent 5480fb1d
...@@ -51,7 +51,7 @@ export default { ...@@ -51,7 +51,7 @@ export default {
updateCurrentRowData() { updateCurrentRowData() {
const { states, table } = this; const { states, table } = this;
const { rowKey, _currentRowKey } = states; const { rowKey, _currentRowKey } = states;
// data 为 null 时,构时的默认值会被忽略 // data 为 null 时,构时的默认值会被忽略
const data = states.data || []; const data = states.data || [];
const oldCurrentRow = states.currentRow; const oldCurrentRow = states.currentRow;
......
...@@ -212,7 +212,7 @@ export default Vue.extend({ ...@@ -212,7 +212,7 @@ export default Vue.extend({
updateAllSelected() { updateAllSelected() {
const states = this.states; const states = this.states;
const { selection, rowKey, selectable } = states; const { selection, rowKey, selectable } = states;
// data 为 null 时,构时的默认值会被忽略 // data 为 null 时,构时的默认值会被忽略
const data = states.data || []; const data = states.data || [];
if (data.length === 0) { if (data.length === 0) {
states.isAllSelected = false; states.isAllSelected = false;
......
...@@ -111,7 +111,7 @@ class TableLayout { ...@@ -111,7 +111,7 @@ class TableLayout {
} }
this.fixedBodyHeight = this.scrollX ? (this.bodyHeight - this.gutterWidth) : this.bodyHeight; 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.viewportHeight = this.scrollX ? tableHeight - (noData ? 0 : this.gutterWidth) : tableHeight;
this.updateScrollY(); this.updateScrollY();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment