Merge branch 'feature/20251001-gil' into feature/20250910-all
This commit is contained in:
@@ -5,6 +5,7 @@ import type {
|
||||
PageDataTemplateComponentSet,
|
||||
PageDataResourceGroups,
|
||||
} from '#layers/types/api/pageData'
|
||||
import { useSplideArrow } from '#layers/composables/useSplideArrow'
|
||||
|
||||
interface Props {
|
||||
slideData: PageDataTemplateComponentSet[]
|
||||
@@ -18,6 +19,11 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
drag: true,
|
||||
})
|
||||
|
||||
const emit = defineEmits(['arrowClick'])
|
||||
|
||||
// Splide 화살표 로직을 위한 composable 사용
|
||||
const { addArrowClickListeners } = useSplideArrow()
|
||||
|
||||
let mainInst: SplideType | null = null
|
||||
let thumbsInst: SplideType | null = null
|
||||
|
||||
@@ -85,6 +91,13 @@ onMounted(() => {
|
||||
|
||||
if (mainInst && thumbsInst) {
|
||||
mainInst.sync(thumbsInst)
|
||||
|
||||
// 썸네일 슬라이드의 화살표 버튼에 이벤트 리스너 추가
|
||||
nextTick(() => {
|
||||
addArrowClickListeners(thumbsInst, (direction, targetIndex) => {
|
||||
emit('arrowClick', direction, targetIndex)
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user