Skip to content
Advertisement

How to use swiper breakpoints in Vue Js

Good morning, I’m making a site using VueJS for the frontend, I have installed SwiperJS via npm for Vue to make sliders. It works fine but i’m not able to make functioning breakpoints to have a responsive number of slides. I used this code to make a responsive post section that has all 4 posts showed in the PC view and only one at a time on the mobile view (and you can also scroll to the posts on mobile view )

This is my code:

slider.vue

JavaScript

Advertisement

Answer

You need to pass the options object to the Swiper like this:

JavaScript

Also for other properties: https://swiperjs.com/vue. Vue component takes properties one at a time. This can also be checked using devtools: enter image description here

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement