Swiper中文论坛
标题:
vue SPA同一页面多个组件使用swiper,按钮互串
[打印本页]
作者:
黑山老妖
时间:
2019-4-2 11:39
标题:
vue SPA同一页面多个组件使用swiper,按钮互串
同一页面,多个组件中都使用了swiper组件,但是当改变swiper左右前进按钮的时候,会引发多个swiper互串,一个按钮控制多个swiper组件内块的滑动
<swiper :options="swiperOption">
<swiper-slide>
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
<div class="swiper-button-prev" slot="button-prev">
<i class="ivu-icon ivu-icon-ios-arrow-back"></i>
</div>
<div class="swiper-button-next" slot="button-next">
<i class="ivu-icon ivu-icon-ios-arrow-forward"></i>
</div>
复制代码
<div class="swiper-wrap">
<swiper :options="swiperOption" ref="mySwiper">
<swiper-slide >
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
<div class="swiper-button-prev" slot="button-prev">
<i class="ivu-icon ivu-icon-ios-arrow-back"></i>
</div>
<div class="swiper-button-next" slot="button-next">
<i class="ivu-icon ivu-icon-ios-arrow-forward"></i>
</div>
</div>
复制代码
第一个和第二个swiper的
swiper-button-next和
swiper-button-prev会相互控制
欢迎光临 Swiper中文论坛 (http://bbs.swiper.com.cn/)
Powered by Discuz! X3.2