我想挂在树上 发表于 2021-8-5 15:15:26

自定义分页器究竟如何使用(custom)

为什么我使用自定义分页器的时候无法使用

yafeng001 发表于 2021-8-7 11:49:14

pagination: {
      el: '.gallery-pagination',
      type : 'custom',
      renderCustom: function (swiper, current, total) {
          const html = `<div class="swiper-dots">
            <span class="swiper-dot ${current === 1 && 'active'}"></span>
            <span class="swiper-dot ${current === 2 && 'active'}"></span>
            <span class="swiper-dot ${current === 3 && 'active'}"></span>
            <span class="swiper-dot ${current === 4 && 'active'}"></span>
            </div>`;
          return html;
      }
      }

我是这么定义的样式,效果和想象的一样

yafeng001 发表于 2021-8-7 11:50:05

用的swiper版本是 5.3

杰富富. 发表于 2021-8-12 11:32:46


用的swiper版本是 5.3

花花 发表于 2021-8-18 16:38:38

6.x如何自定义,求助

TBLZ 发表于 2021-9-14 15:48:53

花花 发表于 2021-8-18 16:38
6.x如何自定义,求助

和5.x不是一样的吗?
页: [1]
查看完整版本: 自定义分页器究竟如何使用(custom)