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'; - + {{item.name}} {{item.age}} diff --git a/src/showcase/nz-demo-table/nz-demo-table.html b/src/showcase/nz-demo-table/nz-demo-table.html index 425ed12dea2..7e23f32a0a6 100644 --- a/src/showcase/nz-demo-table/nz-demo-table.html +++ b/src/showcase/nz-demo-table/nz-demo-table.html @@ -441,9 +441,9 @@

nzShowExpand - 是否展示展开按钮 + 是否显示此 展开/收缩 按钮 Boolean - false + true