Skip to content

Commit

Permalink
fix(module:table): fix table fixed style when nzData change (#4274)
Browse files Browse the repository at this point in the history
close #4253
  • Loading branch information
vthinkxie committed Oct 12, 2019
1 parent 4701ee6 commit b33533c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions components/table/nz-table.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,11 @@ export class NzTableComponent<T = any> implements OnInit, AfterViewInit, OnDestr

@Input() nzItemRender: TemplateRef<PaginationItemRenderContext>;
@ViewChild('renderItemTemplate', { static: true }) itemRenderChild: TemplateRef<PaginationItemRenderContext>;

get itemRender(): TemplateRef<PaginationItemRenderContext> {
return this.nzItemRender || this.itemRenderChild;
}

@Input() @InputBoolean() nzFrontPagination = true;
@Input() @InputBoolean() nzTemplateMode = false;
@Input() @WithConfig(false) @InputBoolean() nzBordered: boolean;
Expand Down Expand Up @@ -269,6 +271,11 @@ export class NzTableComponent<T = any> implements OnInit, AfterViewInit, OnDestr
this.fitScrollBar();
this.setScrollPositionClassName();
}
if (changes.nzData) {
if (this.platform.isBrowser) {
setTimeout(() => this.setScrollPositionClassName());
}
}
if (changes.nzPageIndex || changes.nzPageSize || changes.nzFrontPagination || changes.nzData) {
this.updateFrontPaginationDataIfNeeded(!!(changes.nzPageSize || changes.nzData));
}
Expand Down

0 comments on commit b33533c

Please sign in to comment.