编写通用组件

This commit is contained in:
禾几海
2020-06-30 18:12:23 +08:00
parent b60688cfd7
commit c271b1a8cf
5 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<nz-table>
<thead>
<tr>
<td *ngFor="let headData of data">
{{headData.fieldName}}
</td>
</tr>
</thead>
<tbody>
<tr>
<td *ngFor="let headData of data">
<ng-template [ngIf]="!headData.isActionColumns">
{{headData.fieldName}}
</ng-template>
<ng-template *ngIf="headData.isActionColumns">
<a *ngFor="let action of headData.action" (mouseenter)="action.hover(headData)" (mouseout)="null"
(click)="action.click(headData)" [ngStyle]="{'color':action.color,'font-size':action.fontSize}">
{{action.name}}
</a>
</ng-template>
</td>
</tr>
</tbody>
</nz-table>