Swiper中文论坛
标题:
vue中,swiper分页加载不出来,事件也不能触发
[打印本页]
作者:
tuy
时间:
2020-2-20 12:55
标题:
vue中,swiper分页加载不出来,事件也不能触发
框架:vue-cli2 swiper4 vue-awesome-swiper3.1.3
能正常显示swiper,能正常自动轮播和滑动,就是分页器加载不出,on里的事件也无法响应,求大神们指导,谢谢
<swiper :options="swiperOption" ref="mySwiper">
<swiper-slide v-for="item in componentData.tags" :key="item.id">
<div class="ladies-tag" :style="{ backgroundColor: getBgColor(item.bgstyle) }" @click="toDetail(item.linkpath)" >
<div class="ladies-tag-title">{{ item.title }}</div>
<div class="ladies-tag-tagimg">
<img :src="item.imgpath" :onerror="defaultImg" />
</div>
</div>
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
复制代码
data() {
return {
swiperOption: {
slidesPerView: 'auto',
freeMode: true,
freeModeMomentumRatio: 1,
freeModeMomentumVelocityRatio: 1,
freeModeMomentumBounce: false,
pagination: {
el: '.swiper-pagination',
clickable: true
},
on: {
slideChangeTransitionStart: function() {
console.log('slideChangeTransitionStart')
}
}
}
}
},
复制代码
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2