diff --git a/src/components/table/nz-row-expand-icon.component.ts b/src/components/table/nz-row-expand-icon.component.ts index 3ed26be3db1..6eeba3d9acc 100644 --- a/src/components/table/nz-row-expand-icon.component.ts +++ b/src/components/table/nz-row-expand-icon.component.ts @@ -13,17 +13,22 @@ import { }) export class NzRowExpandIconComponent { @Input() nzExpand = false; - @Input() @HostBinding('class.ant-table-row-spaced') nzShowExpand = false; + @Input() nzShowExpand = true; @Output() nzExpandChange = new EventEmitter(); + @HostBinding('class.ant-table-row-spaced') + get hidden() { + return !this.nzShowExpand; + } + @HostBinding(`class.ant-table-row-expanded`) get expanded() { - return this.nzExpand && !this.nzShowExpand; + return this.nzShowExpand && this.nzExpand; } @HostBinding(`class.ant-table-row-collapsed`) get collapsed() { - return !this.nzExpand && !this.nzShowExpand; + return this.nzShowExpand && !this.nzExpand; } @HostBinding(`class.ant-table-row-expand-icon`) _expandIcon = true; diff --git a/src/showcase/nz-demo-table/nz-demo-table-expand-tree.component.ts b/src/showcase/nz-demo-table/nz-demo-table-expand-tree.component.ts index eac77643339..9c0566ff79c 100644 --- a/src/showcase/nz-demo-table/nz-demo-table-expand-tree.component.ts +++ b/src/showcase/nz-demo-table/nz-demo-table-expand-tree.component.ts @@ -17,7 +17,7 @@ import { Component, OnInit } from '@angular/core';