This commit is contained in:
Taric Xin
2022-03-07 16:20:41 +08:00
parent d97347e720
commit 28837d56a6
2 changed files with 14 additions and 5 deletions

View File

@ -1,3 +1,10 @@
<div class="imgBox"> <div class="imgBox">
<img *ngFor="let item of imgList; let i = index" nz-image [nzSrc]="item" /> <ng-container *ngFor="let item of imgList; let i = index">
<ng-container *ngIf="item; else elseTemplate">
<img nz-image [nzSrc]="item" />
</ng-container>
<ng-template #elseTemplate>
<div style="background-color: darkgrey;border-radius: 5px;width: 200px;height: 160px;" class="mr-sm"></div>
</ng-template>
</ng-container>
</div> </div>

View File

@ -1,9 +1,11 @@
.imgBox { .imgBox {
width: 100%; width : 100%;
overflow: hidden; overflow: hidden;
display : flex;
img { img {
width: 100px; width : 100px;
margin: 0 10px; margin : 0 10px;
vertical-align: middle; vertical-align: middle;
} }
} }