陈鹏飞 5 years ago
parent
commit
1bc47efefa
  1. 3
      src/app/ui/key-site/keysiteimgs.component.html
  2. 6
      src/app/ui/key-site/keysiteimgs.component.ts

3
src/app/ui/key-site/keysiteimgs.component.html

@ -2,7 +2,8 @@
<div class="swiper-container">
<div class="swiper-wrapper">
<div *ngFor="let item of allImages" class="swiper-slide previewImgBox">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270}" [src]="item">
<img [ngClass]="{'rotateA':rotationAngle==90,'rotateB':rotationAngle==180,'rotateC':rotationAngle==270} " class="swiper-lazy" [attr.data-src]="item">
</div>
</div>

6
src/app/ui/key-site/keysiteimgs.component.ts

@ -25,17 +25,19 @@ export class KeySiteImgs {
});
}
ngAfterViewInit() {
ngAfterViewInit() {
this.testSwiper = new Swiper('.swiper-container', {
direction: 'horizontal',
loop: false,
lazy: true,
// 如果需要前进后退按钮
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
}
});
}
allImages:any; //展示所有的图片

Loading…
Cancel
Save