如何解决为“ Swiper分页”子弹添加多个类别
我正在尝试向每个分页项目符号添加新的element class
,并且我想保留swiper
的默认样式。所以我所做的是
pagination={
clickable: true,bulletClass: `swiper-pagination-bullet ${style['feature-pagination']}`,}
我能够得到swiper-pagination-bullet
的样式和自定义样式。但是,其他功能不再起作用(例如,点击功能,活动选择)
我试图检查代码,看来swiper
当前未处理多个类,因为此line of code返回empty
,因为它只期待一个类。 / p>
有没有解决的办法?我喜欢为此创建请求请求,但是我想在这里询问我所缺少的社区。 p>
解决方法
更新
现在,该changes支持多个类。您可以通过使用空格分隔多个类来添加
pagination={
clickable: true,bulletClass: `swiper-pagination-bullet ${style['feature-pagination']}`,}
旧
因此,我请求了enhancement to Swiper Repository。到目前为止,处理bulletClass
和bulletActiveClass
的请求仍然没有被接受。
同时,这是最好的解决方法。
pagination={
clickable: true,bulletClass: `swiper-pagination-bullet`,renderBullet: (index,className) => {
return `<span class="${className} feature-pagination"></span>`;
}
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。