Как сделать чтобы до цифры 10 добавлялся 0 (например 01, 02, .. , 10, 11)
var swiper = new Swiper('.our_clients', {
loop: true,
observer: true,
observeParents: true,
grabCursor: true,
pagination: {
el: '.swiper-pagination',
type: 'fraction',
clickable: true,
renderFraction: (currentClass, totalClass) => `
<span class="${currentClass}"></span> /
<span class="${totalClass}"></span>`,
},
navigation: {
nextEl: '.swiper-button-next',
prevEl: '.swiper-button-prev',
},
scrollbar: {
el: '.swiper-scrollbar',
},
});
function updateFraction(slider) {
const {
params,
activeIndex
} = slider;
slider.$el
.find(`.${params.pagination.currentClass}`)
.text(`${activeIndex + 1} - ${activeIndex + params.slidesPerView}`);
slider.$el
.find(`.${params.pagination.totalClass}`)
.text(slider.slides.length)
}