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

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

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

angular引入swiper

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

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

基礎(chǔ)功能導(dǎo)入

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,
        }, 
      });
    }
  }

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

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

相關(guān)文章

最新評論