Skip to content

Commit

Permalink
Table: fix table header height after filter (ElemeFE#17348)
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyoung authored and hzsrc committed Feb 2, 2023
1 parent 111f286 commit 9e5d09c
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/table/src/store/current.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/store/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/table/src/table-layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 9e5d09c

Please sign in to comment.