轮播图的小圆点显示不出来
来源:2-6 Vue项目首页 - 首页轮播图(2)
慕斯卡8219338
2020-10-12 14:34:00
<template>
<div class="wrapper">
<swiper :options="swiperOptions">
<swiper-slide>
<img class="swiper-img" src="https://imgs.qunarzz.com/sight/source/1811/15/66f14e0fd6fbb.jpg_r_640x214_5d69f21d.jpg">
</swiper-slide>
<swiper-slide>
<img class="swiper-img" src="https://imgs.qunarzz.com/sight/source/1811/b8/5d599bbdcf8b57.jpg_r_640x214_2ee055e3.jpg">
</swiper-slide>
<div class="swiper-pagination" slot="pagination"></div>
</swiper>
</div>
</template>
<script>
export default {
name: 'HomeSwiper',
data () {
return {
swiperOptions: {
pagination: '.swiper-pagination',
loop: true
}
}
}
}
</script>
<style lang="stylus" scoped>
.wrapper >>> .swiper-pagination-bullet-active
background: #fff
.wrapper
overflow: hidden
width: 100%
height: 0
padding-bottom: 31.25%
background: #eee
.swiper-img
width: 100%
</style>
1回答
好帮手慕久久
2020-10-12
同学你好,老师这里测试,有小圆点的html结构,但是由于同学使用的图片,与源码不同,导致小点的位置太靠下,所以看不到,如下:

建议同学先检查一下是不是上述原因。
如果html结构上没有小点的html结构,则更换一下swiper版本试试:npm i vue-awesome-swiper@2.6.7 --save。
如果我的回答帮到了你,望采纳,祝学习愉快!
相似问题