svelte-swiper icon indicating copy to clipboard operation
svelte-swiper copied to clipboard

Wrong swiper instance example

Open EinLinuus opened this issue 3 years ago • 0 comments

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.

EinLinuus avatar Feb 04 '22 15:02 EinLinuus