You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@RemyAlbanes This actually might be related to this PR #140. I will have to double check the code, but this could be due to it returning the computed instance of the swiper, I will take a look here soon.
After several tries, I'm stuck on a problem:
I can't manipulate the instance after initializing my swiper with “init:false”.
If I go back to the examples, I can use my 'swiper.prev' and 'swiper.next' buttons in this example:
<script setup> // Create 10 slides const containerRef = ref(null) const slides = ref(Array.from({ length: 10 })) const swiper = useSwiper(containerRef) onMounted(() => { console.log(swiper.instance) }) </script> Slide {{ idx + 1 }}`
<button @click="swiper.prev()">
Prev
<button @click="swiper.next()">
<style lang="css"> swiper-slide { display: flex; justify-content: center; align-items: center; font-size: 18px; height: 20vh; font-size: 4rem; font-weight: bold; font-family: 'Roboto', sans-serif; } </style>Next
`
But they no longer work in this one:
`
<script setup> const containerRef = ref(null) const slides = ref(Array.from({ length: 10 })) const swiper = useSwiper(containerRef,{ slidesPerView:1 }) onMounted(() => { console.log(swiper.instance) }) </script> Slide {{ idx + 1 }}<button @click="swiper.prev()">
Prev
<button @click="swiper.next()">
<style lang="css"> swiper-slide { display: flex; justify-content: center; align-items: center; font-size: 18px; height: 20vh; font-size: 4rem; font-weight: bold; font-family: 'Roboto', sans-serif; } </style>Next
`
Is it a bug? Or am I doing something wrong?
The text was updated successfully, but these errors were encountered: