设置disableOnInteraction: false后,手动操作之后仍无法保持继续轮播状态
代码给老师看一下吧,我这个是子组件
<template>
<div class="waper">
<!-- v-if="list.length",可以解决一系列ajax相应于页面数据渲染之间的问题 -->
<!-- 这句话的意思是,只有当数据获取到时,才开始渲染页面 -->
<swiper ref="mySwiper" :options="swiperOptions" v-if="list.length">
<swiper-slide v-for="(item, index) in list" :key="item.id">
<img class="swiper-img" :src="item.imgUrl" />
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
</div>
</template>
<script>
export default {
name: "HomeSwiper",
props:{
list:Array
},
data() {
return {
swiperOptions: {
// pagination 后面和swiper组件绑定
pagination: ".swiper-pagination",
// loop:true 可以设置无缝滚动
loop:true,
autoplay:{
/* 触摸滑动后是否继续轮播 */
disableOnInteraction: false
},
speed:2000
},
};
}
};
</script>
<style lang="stylus" scoped>
// >>> 可以无视 scoped,直接穿透到全局样式定义
.waper >>> .swiper-pagination-bullet-active {
background-color: #fff !important;
}
.waper {
overflow: hidden;
width: 100%;
height: 0;
// 导航栏的小圆点看不到时,设置这个padding-bottom 的值大一点,被遮住了
padding-bottom: 39%;
background-color: #eee;
.swiper-img {
width: 100%;
}
}
</style>14
收起
正在回答 回答被采纳积分+1
2回答
4.Vue与React高级框架开发
- 参与学习 人
- 提交作业 239 份
- 解答问题 10739 个
本阶段带你深入前端开发的肌理,通过ES6基础知识和前端主流高级框架的学习,助你快速构建企业级移动webAPP应用,进入职场的终极battle
了解课程

恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星