From 80df4896231af7c87c89457ee56cf74e5f699da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=89=A7=E8=A1=A1?= Date: Mon, 18 Dec 2017 15:59:44 +0800 Subject: [PATCH] fix(module:table): fix the missing of init table sort class close #771 --- src/components/table/nz-table-sort.component.ts | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/components/table/nz-table-sort.component.ts b/src/components/table/nz-table-sort.component.ts index c8a6b103dfb..989b21119e4 100644 --- a/src/components/table/nz-table-sort.component.ts +++ b/src/components/table/nz-table-sort.component.ts @@ -3,7 +3,6 @@ import { EventEmitter, Host, Input, - OnInit, Optional, Output, Renderer2, @@ -43,20 +42,18 @@ export class NzTableSortComponent { if (this.nzThDirective) { this._renderer.removeClass(this.nzThDirective._el, 'ant-table-column-sort'); } + } else { + if (this.nzThDirective) { + this._renderer.addClass(this.nzThDirective._el, 'ant-table-column-sort'); + } } } _setValue(value: string): void { if (this.nzValue === value) { this.nzValue = null; - if (this.nzThDirective) { - this._renderer.removeClass(this.nzThDirective._el, 'ant-table-column-sort'); - } } else { this.nzValue = value; - if (this.nzThDirective) { - this._renderer.addClass(this.nzThDirective._el, 'ant-table-column-sort'); - } } this.nzValueChange.emit(this.nzValue); }