fix: [디자인QA] 슬라이드 인덱스 전환 시 영상이 처음부터 재생되도록 적용

This commit is contained in:
clkim
2025-12-03 15:43:21 +09:00
parent 73adfc9769
commit fd479483bb
15 changed files with 179 additions and 138 deletions

View File

@@ -4,7 +4,6 @@ import {
getComponentContainer,
getComponentGroupAry,
} from '#layers/utils/dataUtil'
import type { Splide as SplideType } from '@splidejs/splide'
import type { PageDataTemplateComponents } from '#layers/types/api/pageData'
interface Props {
@@ -30,14 +29,6 @@ const goToSlide = (index: number) => {
splide.go(index)
}
}
const handleSplideMounted = (splide: SplideType) => {
currentSlideIndex.value = splide.index
}
const handleSplideMove = (_splide: SplideType, newIndex: number) => {
currentSlideIndex.value = newIndex
}
</script>
<template>
@@ -45,17 +36,17 @@ const handleSplideMove = (_splide: SplideType, newIndex: number) => {
<BlocksSlideFade
v-if="slideData"
ref="splideRef"
v-model:index="currentSlideIndex"
:autoplay="true"
:arrows="false"
:pagination="false"
class="h-full"
@move="handleSplideMove"
@mounted="handleSplideMounted"
>
<SplideSlide v-for="(item, index) in slideData" :key="index">
<WidgetsBackground
v-if="hasComponentGroup(item, 'background')"
:resources-data="getComponentGroup(item, 'background')"
:video-play="currentSlideIndex === index"
/>
<div class="content-standard">
<WidgetsMainTitle