diff --git a/src/components/Carousel/Carousel.ts b/src/components/Carousel/Carousel.ts index acf418da..a2e17250 100644 --- a/src/components/Carousel/Carousel.ts +++ b/src/components/Carousel/Carousel.ts @@ -75,7 +75,10 @@ export const Carousel = defineComponent({ // current active config const config = reactive({ ...fallbackConfig.value }) - watch(fallbackConfig, () => Object.assign(config, fallbackConfig.value)) + watch(fallbackConfig, () => { + Object.assign(config, fallbackConfig.value) + updateBreakpointsConfig() + }) // slides const currentSlideIndex = ref(props.modelValue ?? 0) diff --git a/src/components/Slide/Slide.ts b/src/components/Slide/Slide.ts index 6fbafa75..7112d650 100644 --- a/src/components/Slide/Slide.ts +++ b/src/components/Slide/Slide.ts @@ -13,6 +13,7 @@ import { onMounted, VNode, onUpdated, + watch, } from 'vue' import { injectCarousel } from '@/injectSymbols' @@ -44,6 +45,7 @@ export const Slide = defineComponent({ } const index = ref(props.index) + watch(() => props.index, (i) => index.value = i) const isActive: ComputedRef = computed( () => index.value === carousel.currentSlide diff --git a/tests/integration/__snapshots__/carousel.spec.ts.snap b/tests/integration/__snapshots__/carousel.spec.ts.snap index 134e5851..c183210c 100644 --- a/tests/integration/__snapshots__/carousel.spec.ts.snap +++ b/tests/integration/__snapshots__/carousel.spec.ts.snap @@ -13,9 +13,9 @@ exports[`SSR Carousel > renders server side properly 1`] = ` - - - + + +