Closed cooperfrench95 closed 2 years ago
I am also getting this error, there seems to be no way to set the current slide programatically that won't trigger this error.
Try and set the modelValue or v-model value after the component has mounted. Then you don't get the maximum call stack size exceed error.
Working example code:
<template>
<carousel
wrap-around
v-model="initialSlide">
<slide v-for="slide in 10" :key="slide">
{{ slide }}
</slide>
<template #addons="{ currentSlide, slidesCount }">
<Navigation />
<div>
{{ currentSlide + 1 }} / {{ slidesCount }}
</div>
</template>
</carousel>
</template>
<script>
import { ref, onMounted } from 'vue';
import { Carousel, Slide, Navigation } from 'vue3-carousel';
import 'vue3-carousel/dist/carousel.css';
export default {
name: 'Carousel',
components: {
Carousel,
Slide,
Navigation,
},
setup() {
const initialSlide = ref(undefined);
onMounted(() => {
initialSlide.value = 0;
});
return {
initialSlide,
};
},
};
</script>
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
modelValue
prop breaks the component completely withMaximum call stack size exceeded.
The error comes from hereReproduction link: https://codesandbox.io/s/vue3-carousel-issue-repro-lo1dx?file=/src/App.vue