svelte-swiper
svelte-swiper copied to clipboard
Wrong swiper instance example
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.