Skip to content

Commit

Permalink
feat(module:collapse): support custom header (#383)
Browse files Browse the repository at this point in the history
  • Loading branch information
SangKa authored and vthinkxie committed Sep 30, 2017
1 parent 8fb32c6 commit ca42f00
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/collapse/nz-collapse.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@ import { NzCollapsesetComponent } from './nz-collapseset.component'
template : `
<div class="ant-collapse-header" [attr.aria-expanded]="_active" (click)="clickHeader($event)" role="tab">
<i class="arrow"></i>
{{ nzTitle }}
<ng-template [ngIf]="nzTitle">
{{ nzTitle }}
</ng-template>
<ng-template [ngIf]="!nzTitle">
<ng-content select="[collapse-title]"></ng-content>
</ng-template>
</div>
<div class="ant-collapse-content" [@collapseState]="_active?'active':'inactive'">
<div class="ant-collapse-content-box">
Expand Down
6 changes: 6 additions & 0 deletions src/showcase/nz-demo-collapse/nz-demo-collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@ <h3 id="Collapse.Panel"><span>nz-collapse</span>
<td>Boolean</td>
<td>false</td>
</tr>
<tr>
<td>[collapse-title]</td>
<td>与nzTitle二选一,定义面板头内容</td>
<td>ng-content</td>
<td></td>
</tr>
</tbody>
</table>
</section>
Expand Down

0 comments on commit ca42f00

Please sign in to comment.