Angular引入swiper后autoplay失效的解決辦法詳解
angular引入swiper
由于angular不熟,最近在修改一個(gè)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失效的資料請(qǐng)關(guān)注腳本之家其它相關(guān)文章!
相關(guān)文章
angularjs1.5 組件內(nèi)用函數(shù)向外傳值的實(shí)例
今天小編就為大家分享一篇angularjs1.5 組件內(nèi)用函數(shù)向外傳值的實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過來看看吧2018-09-09
AngularJS控制器controller給模型數(shù)據(jù)賦初始值的方法
這篇文章主要介紹了AngularJS控制器controller給模型數(shù)據(jù)賦初始值的方法,涉及AngularJS控制器controller簡(jiǎn)單賦值操作實(shí)現(xiàn)技巧,需要的朋友可以參考下2017-01-01
angular中實(shí)現(xiàn)li或者某個(gè)元素點(diǎn)擊變色的兩種方法
本篇文章主要介紹了angular中實(shí)現(xiàn)li或者某個(gè)元素點(diǎn)擊變色的兩種方法,非常具有實(shí)用價(jià)值,需要的朋友可以參考下2017-07-07
Angular開發(fā)實(shí)踐之服務(wù)端渲染
這篇文章主要介紹了Angular開發(fā)實(shí)踐之服務(wù)端渲染,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-03-03
AngularJs實(shí)現(xiàn)ng1.3+表單驗(yàn)證
這篇文章主要介紹了AngularJs實(shí)現(xiàn)ng1.3+表單驗(yàn)證,感興趣的小伙伴們可以參考一下2015-12-12
angularjs ocLazyLoad分步加載js文件實(shí)例
本篇文章主要介紹了angularjs ocLazyLoad分步加載js文件,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2017-01-01
AngularJS基礎(chǔ) ng-keypress 指令簡(jiǎn)單示例
本文主要介紹AngularJS ng-keypress 指令,這里幫大家整理了基礎(chǔ)資料,并附是示例代碼,有需要的小伙伴可以參考下2016-08-08
發(fā)布Angular應(yīng)用至生產(chǎn)環(huán)境的方法
這篇文章主要介紹了發(fā)布Angular應(yīng)用至生產(chǎn)環(huán)境的方法,小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過來看看吧2018-12-12

