diff --git a/layers/components/blocks/slide/Fade.vue b/layers/components/blocks/slide/Fade.vue index c655107..102da9f 100644 --- a/layers/components/blocks/slide/Fade.vue +++ b/layers/components/blocks/slide/Fade.vue @@ -18,9 +18,9 @@ const props = withDefaults(defineProps(), { const emit = defineEmits(['mounted', 'move', 'moved', 'arrowClick']) +const splideRef = ref() // Splide 화살표 로직을 위한 composable 사용 const { addArrowClickListeners } = useSplideArrow() -const splideRef = ref() const options = computed((): ResponsiveOptions => { return { diff --git a/layers/components/blocks/slide/Thumbnail.vue b/layers/components/blocks/slide/Thumbnail.vue index eea08e5..520d53c 100644 --- a/layers/components/blocks/slide/Thumbnail.vue +++ b/layers/components/blocks/slide/Thumbnail.vue @@ -14,17 +14,16 @@ interface Props { drag?: boolean } +const props = withDefaults(defineProps(), { + variant: 'default', + drag: true, +}) const emit = defineEmits(['arrowClick']) // Splide 화살표 로직을 위한 composable 사용 const { addArrowClickListeners } = useSplideArrow() -const props = withDefaults(defineProps(), { - variant: 'default', - drag: true, -}) - let mainInst: SplideType | null = null let thumbsInst: SplideType | null = null @@ -92,7 +91,6 @@ onMounted(() => { if (mainInst && thumbsInst) { mainInst.sync(thumbsInst) - // 썸네일 슬라이드의 화살표 버튼에 이벤트 리스너 추가 nextTick(() => { addArrowClickListeners(thumbsInst, (direction, targetIndex) => { diff --git a/layers/templates/GrGallery01/index.vue b/layers/templates/GrGallery01/index.vue index 585c0bb..d714fd9 100644 --- a/layers/templates/GrGallery01/index.vue +++ b/layers/templates/GrGallery01/index.vue @@ -85,10 +85,9 @@ const stopVideo = () => { } const onArrowClick = (direction, targetIndex) => { - const logTraking = direction == 'prev' ? - getComponentGroupAry(props.components, 'arrow')[0] : - getComponentGroupAry(props.components, 'arrow')[1]; - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } onMounted(() => { diff --git a/layers/templates/GrGallery02/index.vue b/layers/templates/GrGallery02/index.vue index 7edce16..73b7715 100644 --- a/layers/templates/GrGallery02/index.vue +++ b/layers/templates/GrGallery02/index.vue @@ -57,11 +57,9 @@ const handleChange = ( const { locale } = useI18n() const { sendLog, useAnalyticsLogDataDirect } = useAnalytics() const onArrowClick = (direction, targetIndex) => { - const logTraking = - direction == 'prev' - ? getComponentGroupAry(props.components, 'arrow')?.groups[0] - : getComponentGroupAry(props.components, 'arrow')?.groups[1] - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } diff --git a/layers/templates/GrGallery03/index.vue b/layers/templates/GrGallery03/index.vue index 5f77fae..115d773 100644 --- a/layers/templates/GrGallery03/index.vue +++ b/layers/templates/GrGallery03/index.vue @@ -60,11 +60,12 @@ const handleChange = ( 'buttonList' ) } -const {locale} = useI18n() +const { locale } = useI18n() const { sendLog, useAnalyticsLogDataDirect } = useAnalytics() const onArrowClick = (direction, targetIndex) => { - const logTraking = direction == 'prev' ? props.components.arrow.groups[0] : props.components.arrow.groups[1]; - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } diff --git a/layers/templates/GrVisual02/index.vue b/layers/templates/GrVisual02/index.vue index e4a4595..938d894 100644 --- a/layers/templates/GrVisual02/index.vue +++ b/layers/templates/GrVisual02/index.vue @@ -71,11 +71,12 @@ const slideItemSize = { gap: 32, }, } -const {locale} = useI18n() +const { locale } = useI18n() const { sendLog, useAnalyticsLogDataDirect } = useAnalytics() const onArrowClick = (direction, targetIndex) => { - const logTraking = direction == 'prev' ? props.components.arrow.groups[0] : props.components.arrow.groups[1]; - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) } console.log('resourcesData.value===', resourcesData.value) diff --git a/layers/templates/GrVisual03/index.vue b/layers/templates/GrVisual03/index.vue index 60711db..f36c959 100644 --- a/layers/templates/GrVisual03/index.vue +++ b/layers/templates/GrVisual03/index.vue @@ -24,11 +24,9 @@ const slideData = computed(() => { }) const onArrowClick = direction => { - const logTraking = - direction == 'prev' - ? getComponentGroupAry(props.components, 'arrow')?.groups[0] - : getComponentGroupAry(props.components, 'arrow')?.groups[1] - sendLog(locale.value, useAnalyticsLogDataDirect(logTraking, 1)) + const arrowGroupAry = getComponentGroupAry(props.components, 'arrow') + const logTracking = arrowGroupAry?.[direction === 'prev' ? 0 : 1] + sendLog(locale.value, useAnalyticsLogDataDirect(logTracking, 1)) }