feat: 슬라이드 화살표 클릭 로그 추가 및 관련 로직 개선

This commit is contained in:
“hyeonggkim”
2025-10-20 20:08:10 +09:00
parent 9f6056ef77
commit a36489c264
9 changed files with 139 additions and 91 deletions

View File

@@ -18,7 +18,10 @@ const props = withDefaults(defineProps<Props>(), {
pagination: true,
})
const emit = defineEmits(['mounted', 'move', 'moved'])
const emit = defineEmits(['mounted', 'move', 'moved', 'arrowClick'])
// Splide 화살표 로직을 위한 composable 사용
const { addArrowClickListeners } = useSplideArrow()
const isMultipleItems = computed(() => {
return props.slideItemLength > 1
@@ -85,6 +88,13 @@ const style = computed(() => {
const handleSplideMounted = (splide: SplideType) => {
emit('mounted', splide)
splide.refresh()
// 화살표 버튼 클릭 이벤트 리스너 추가
nextTick(() => {
addArrowClickListeners(splide, (direction, targetIndex) => {
emit('arrowClick', direction, targetIndex)
})
})
}
const handleMove = (