3

我正在尝试为element class每个分页项目符号添加一个新的,并且我想保留swiper. 所以我所做的是

pagination={
    clickable: true,
    bulletClass: `swiper-pagination-bullet ${style['feature-pagination']}`,
}

我能够获得风格swiper-pagination-bullet和我的自定义风格。但是,其他功能不再起作用(例如单击功能、主动选择)

我试图检查代码,看起来swiper当前没有处理多个类,因为这行代码返回empty,因为它只需要一个类。

有什么解决方法吗?我喜欢为此创建拉取请求,但我想问问我在这里失踪的社区。

4

1 回答 1

0

更新

现在它通过这种变化支持多个类。您可以通过用空格分隔它们来添加多个类

pagination={
    clickable: true,
    bulletClass: `swiper-pagination-bullet ${style['feature-pagination']}`,
}

老的

所以我要求对 Swiper Repository 进行增强。截至目前,处理的拉取请求bulletClass仍未bulletActiveClass被接受。

同时,这是最好的解决方法。

pagination={
    clickable: true,
    bulletClass: `swiper-pagination-bullet`,
    renderBullet: (index, className) => {
    return `<span class="${className} feature-pagination"></span>`;
    }
}
于 2020-11-02T06:18:45.737 回答