Swiper中文论坛
标题:
指示器hover问题
[打印本页]
作者:
yufile
时间:
2021-10-29 09:05
标题:
指示器hover问题
// 使用了 自定义分页器,但是需要使用hover分页器切换图片,浏览器没有缓存的时候第一次加载,会导致hover分页器无法使用原因是
// `
bullets`没有长度,不知道各位大神有没有解决办法
renderBullet
:
(
index
,
className
)
=>
{
return
`
<
span class="
$
{
className
}
">
<div>
<span class="title">
$
{
manipulatingFont
(
this
.
setBanner
[
index
]
.
title
,
30
)}</
span
>
<
span class="info"
>
$
{
this
.
setBanner
[
index
]
.
description
? manipulatingFont
(
this
.
setBanner
[
index
]
.
description
,
40
)
:
''
}</
span
>
</
div
>
<
span class="hui"
></
span
>
</
span
>
`
;
}
methods: {
etJurisdiction
(
as
) {
setTimeout
(()
=>
{
console
.
log
(
1
)
for
(
let
i
=
0
;
i
<
as
.
bullets
.
length
;
i
++
) {
console
.
log
(
2
)
const
that
=
this
;
as
.
bullets
[
i
]
.
index
=
i
as
.
bullets
[
i
]
.
onmouseover
=
function
() {
that
.mySwiper.
slideTo
(
this
.
index
+
1
)
;
that
.mySwiper.
autoplay
.
stop
()
}
;
as
.
bullets
[
i
]
.
onmouseleave
=
function
() {
that
.mySwiper.
autoplay
.
start
()
}
;
as
.
bullets
[
i
]
.
onclick
=
function
() {
if
(
that
.
setBanner
[
this
.
index
]
.
url
) {
window
.
location
.
href
=
that
.
setBanner
[
this
.
index
]
.
url
}
}
}
}
,
1000
)
}
}
作者:
stylish
时间:
2021-11-2 16:02
组件初始化数据前添加loading,template里面swiper组件上添加v-if="!loading"
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2