欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

Angular引入swiper后autoplay失效的解決辦法詳解

 更新時間:2023年09月19日 10:00:32   作者:秋刀魚Bin  
這篇文章主要介紹了Angular引入swiper后autoplay失效的解決辦法詳解,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪

angular引入swiper

由于angular不熟,最近在修改一個NG-ZORRO的項目。

期間為了引入swiper,按照網上的安裝引入方式(這步就不說了,應該都能搜到),引入后發(fā)現(xiàn)autoplay怎么設置都沒效果,試了很多辦法,后面去swiperjs官網看了才發(fā)現(xiàn)這段話。

基礎功能導入

import { Swiper, Autoplay } from 'swiper';
Swiper.use([Autoplay]);
export class TestComponent {
    swiper: Swiper;
    constructor(){}
    ngAfterViewInit() {
      this.swiper = new Swiper('.swiper-container', {
        slidesPerView: 3,
        initialSlide :1,
        centeredSlides: true,
        loop: true,
        observer: true,
        observeParents: true,
        autoplay:{ 
          delay:2000,
          disableOnInteraction:false,
          stopOnLastSlide: false,
        }, 
      });
    }
  }

結束收工!_(:з」∠)_

以上就是Angular引入swiper后autoplay失效的解決辦法詳解的詳細內容,更多關于Angular引入swiper autoplay失效的資料請關注腳本之家其它相關文章!

相關文章

最新評論