最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Angular引入swiper后autoplay失效的解决办法详解
时间:2026-06-10 10:13:55 编辑:袖梨 来源:一聚教程网
angular引入swiper
由于angular不熟,最近在修改一个NG-ZORRO的项目。
期间为了引入swiper,按照网上的安装引入方式(这步就不说了,应该都能搜到),引入后发现autoplay怎么设置都没效果,试了很多办法,后面去swiperjs官网看了才发现这段话。

基础功能导入
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失效的资料请关注其它相关文章!
相关文章
- 土豆视频网页版入口-土豆视频高清在线播放 12-01
- Hitomi.la最新镜像网站入口 - 2026可用国内访问地址分享 11-26
- 土豆视频网页版入口地址-土豆视频在线播放入口 11-17
- 哔哩哔哩官方网页版入口地址-哔哩哔哩blibili手机电脑网页版入口地址 11-16
- AO3镜像网站最新入口汇总 - 2026可用镜像链接列表 11-16
- 超星学生通登录入口-超星官网网页版登录入口 11-13