<div class="swiper-container">
    <div class="swiper mySwiper">
        <div class="swiper-wrapper">
            {% for sliderElement in element.slider.all() %}
            <div class="swiper-slide"
                style="background-image: url('{{ craft.app.sites.primarySite.baseUrl}}/{{ sliderElement.image.one().url }}');">
                <div class="swiper-slide-content">{{sliderElement.text}}</div>
            </div>
            {% endfor %}
        </div>
        <div class="swiper-button-next" data-controls="next"></div>
        <div class="swiper-button-prev" data-controls="prev"></div>
    </div>
</div>