公共表格组件-title传null隐藏头部显示

This commit is contained in:
禾几海
2020-07-10 23:15:05 +08:00
parent 8a8302eb51
commit eb4b9ea440
2 changed files with 12 additions and 7 deletions

View File

@@ -1,4 +1,14 @@
<nz-card nzSize="small" [nzExtra]="refresh" [nzTitle]="cardTitle" [nzLoading]="loading">
<nz-card *ngIf="cardTitle" nzSize="small" [nzExtra]="refresh" [nzTitle]="cardTitle" [nzLoading]="loading">
<ng-container *ngTemplateOutlet="table"></ng-container>
</nz-card>
<ng-container [ngTemplateOutlet]="table" *ngIf="!cardTitle"></ng-container>
<ng-template #refresh>
<i nz-icon nzType="reload" nzTheme="outline" (click)="getData()" title="刷新" style="cursor: pointer"></i>
</ng-template>
<ng-template #table>
<nz-table nzTableLayout="fixed"
[nzData]="dataList.list"
[nzTotal]="dataList.total"
@@ -57,9 +67,4 @@
</tr>
</tbody>
</nz-table>
</nz-card>
<ng-template #refresh>
<i nz-icon nzType="reload" nzTheme="outline" (click)="getData()" title="刷新" style="cursor: pointer"></i>
</ng-template>