vue买菜系统中遇到的问题以及解决方法

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);
    }
发布了70 篇原创文章 · 获赞 7 · 访问量 9215

猜你喜欢

转载自blog.csdn.net/qq_41893334/article/details/100552486