1.在配置swiper的时候,始终改变不了选中的分页器的样式
自定义类名 没有效果
//分页器
pagination: {
el: '.swiper-pagination',
bulletActiveClass: 'my-bullet-active',
clickable :true,
},
.my-bullet-active{
background-color: yellow;
}
改变默认类名的样式 没有效果
.swiper-pagination-bullet-active{
background-color: rgb(117, 163, 66);
}
加权重 没有效果
#swiper .swiper-pagination-bullet-active{
background-color: rgb(117, 163, 66);
}
还是加!important都 没有效果
#swiper .swiper-pagination-bullet-active{
background-color: rgb(117, 163, 66) !important;
}
终极解决办法 有效果啦
/*
穿透改变样式,拿到父标签直接穿透
*/
#swiper >>> .swiper-pagination-bullet-active{
background-color: rgb(117, 163, 66);
}