SlidesPerView

// Swiper start
@ViewChild('swiperRef', { static: true })
protected _swiperRef: ElementRef<SwiperContainer>;
swiper?: Swiper;

ngAfterViewInit(): void {
  this._initSwiper();
}

private _initSwiper(): void {
  const options: SwiperOptions = {
    slidesPerView: 4,
    loop: true,
    autoplay: {
      delay: 5000,
      pauseOnMouseEnter: false,
    },
  };
  const swiperEl = this._swiperRef.nativeElement;
  Object.assign(swiperEl, options);
  swiperEl.initialize();
}
// Swiper end
Was this page helpful?