Swiper中文论坛
标题:
angular在v8版本的swiper上自动轮播无效
[打印本页]
作者:
MG516
时间:
2024-9-9 18:37
标题:
angular在v8版本的swiper上自动轮播无效
求解答
以下是代码部分
<
div
class
=
"swiper-container"
>
<
div
class
=
"swiper-wrapper"
>
<
div
class
=
"swiper-slide"
*ngFor
=
"
let
item
of
list;
let
i
=
index
"
(click)
=
"
onClick
(item,i)
"
>
<
img
[src]
=
"
item.logoUrl
"
class
=
"pic"
[alt]
=
"
item.tenantName
"
/>
<
div
class
=
"mask"
></
div
>
<
div
class
=
"imgName"
*ngIf
=
"
!
item.logoUrl
"
>
<
span
class
=
" ellipsis-1 title-font-family"
>{{item.tenantName}}</
span
>
</
div
>
</
div
>
</
div
>
</
div
>
this
.publisherSwiper
=
new
Swiper
(
'.
swiper-container
'
, {
modules: [
Navigation
,
Pagination
,
Scrollbar
],
//被选中的滑块居中,默认居左
centeredSlides:
true
,
slideToClickedSlide:
true
,
spaceBetween:
0
,
loop:
true
,
autoplay: {
//手势滑动后继续保持自动滑动
disableOnInteraction:
false
,
delay:
3000
,
},
speed:
1000
,
loopedSlides:
4
,
// 可见图片张数
slidesPerView:
4
,
//控制显示的部分
});
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2