我已经创建了一个自定义组件幻灯片卡,在其中初始化离子幻灯片。
它看起来像这样:
<!-- Generated template for the RestaurantSlideCardComponent component -->
<ion-slides (ionSlideReachEnd)="ionDidSlideReachEnd()">
<ion-slide *ngFor="let restaurant of restaurants"
[routerLink]="'/restaurant/' + restaurant.Restaurant._id" routerDirection="forward" detail="true">
<ion-card class="xs-margin">
<img [attr.src]="restaurant?.picture ? restaurant.picture : 'https://via.placeholder.com/200x100?text=Restaurant'">
<ion-card-content class="xs-padding-v padding-h">
<mm-label>{{ restaurant.Restaurant.Name }}</mm-label>
<mm-star-rating [rating]="4.5"></mm-star-rating>
<div class="info-list xs-margin-t">
<p>{{ restaurant.Restaurant.Distance }} KM away {{ restaurant.city }}</p>
<p [ngClass]="{'closed': restaurant.label === 'closed', 'open': restaurant.label === 'open'}">
{{ restaurant.label }} untill 00:00
</p>
</div>
</ion-card-content>
</ion-card>
</ion-slide>
但是在初始化幻灯片后,用户可以向右无限滑动,内容将消失。有人有同样的问题吗?如何停止这种无限次刷卡?
如果向左滑动,则它会停在第一张幻灯片上,反之亦然,它将不起作用。