我正在使用您在 ionic 3 中的延迟加载来加载图像。 但是只有很少的图像,其余图像不会在滚动时加载。 我没有使用任何对内容的引用。
我的代码
我将您的插件导入为LazyLoadImageModule.forRoot({
preset: intersectionObserverPreset
})
我在我的应用程序中使用它<div class="grid">
<ion-row class="row unlimited-items">
<ion-col col-6 class="col" *ngFor="let item of products ">
<ion-card tappable (click)="getProduct(item.id)">
<img class="image" style="height:auto;width:100%;" [defaultImage]="loadingAnimation" [lazyLoad]="item.images[0].src">
<h5 *ngIf="item.name" class="card-name">{{item.name}}
</h5>
<p class="pricehtml" [innerHTML]="item.price_html"> </p>
</ion-card>
</ion-col>
</ion-row>
</div>
我附上了截图。 等待您的回复。
更新到[email protected]和 angular 7 解决了这个问题。 感谢您解决。
好的! 然后我关闭这个。