【发布时间】:2017-08-22 15:08:27
【问题描述】:
我想在 3x3 表格中显示一组项目,如下所示:
为了实现这一点,我将我的数组分成 3 个数组,每组 3 个,并显示如下:
<ion-grid no-padding class="home-gallery">
<ion-row *ngFor="let row of items | async">
<ion-col *ngFor="let item of row">
<div class="products_list">
<div class="products_list_img">
<img [src]="item.previewImage" (click)="showItem($event, item)"/>
</div>
</div>
</ion-col>
</ion-row>
</ion-grid>
有没有办法在保持阵列展平的同时实现这种显示?
【问题讨论】:
-
我认为您应该使用 Flexbox 来显示结果,请参阅下面的答案。
-
keeping my array flattened你能解释一下吗,我猜你不想有两个 for 循环去获取对象,是这样吗?
标签: css angular ionic-framework ionic2