vue-splide icon indicating copy to clipboard operation
vue-splide copied to clipboard

not able to access controller methods other than .go()

Open Sovai opened this issue 10 months ago • 1 comments

Checks

  • [X] Not a duplicate.
  • [X] Not a question, feature request, or anything other than a bug report directly related to Vue Splide. Use Discussions for these topics: https://github.com/Splidejs/splide/discussions

Version

0.6.12

Description

I have it like this in my template

<template>
       <Splide :options="options" ref="splide" @splide:active="onSlideMove">
          <SplideSlide>
            <TheMainPie />
          </SplideSlide>
          <SplideSlide>
            <TheMainBarChart />
          </SplideSlide>
        </Splide>

[...]
</template>

<script setup>

const splide = ref(null)
onMounted(() => {
  const slider = splide.value.splide;
  slider.go(1); // working as expected
  slider.scroll(1); // Unhandled Promise Rejection: TypeError: slider.scroll is not a function
  slider.move(1) // error
...

})

</script>

Reproduction Link

No response

Steps to Reproduce

  1. setup splide
  2. call splide methods via instance ...

Expected Behaviour

can use all the controller methods from original docs

Sovai avatar Mar 27 '24 05:03 Sovai