-
Notifications
You must be signed in to change notification settings - Fork 1
Wrong swiper instance example #7
Copy link
Copy link
Open
Description
Hi,
the "Swiper instance" example didn't work for me:
<script>
import { Swiper, SwiperSlide } from 'svelte-swiper';
let mySwiper;
function slideTo () {
mySwiper.slideTo(5);
}
</script>
<button on:click={slideTo}>slideTo</button>
<Swiper bind:swiper={mySwiper}>
<!-- ... -->
</Swiper>When I copied the example and tried it, mySwiper was a function that returned the instance - so I changed the code to mySwiper().slideTo(5) and it worked.
It would be great if the example is corrected.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels