我想在我的Swiper carousel 中有图像而不是项目符号,但文档中不清楚如何实现这一点.
在renderCustom
个函数中,如何区分活动和非活动?
<Swiper
modules={[Navigation, Pagination]}
spaceBetween={10}
slidesPerView={2}
navigation
pagination={{
clickable: true,
type: "custom",
renderCustom: function(swiper, current, total) {
}
}}
...
我甚至try 在css中重写bullet类,但什么都没有改变:
.swiper-pagination-bullet {
background-image: url('../../../assets/images/slider-pagination.png') !important;
}
.swiper-pagination-bullet-active {
background-image: url('../../../assets/images/slider-pagination-active.png') !important;
}