fix. 공통 함수, 샘플 이미지 수정

This commit is contained in:
clkim
2025-10-27 17:38:46 +09:00
parent 24a934576c
commit 624e01472e
53 changed files with 21 additions and 17 deletions

View File

@@ -7,6 +7,7 @@ interface Props {
type?: ResponsiveOptions['type']
slideItemLength?: number
autoplay?: boolean
perPage?: number
arrows?: boolean
pagination?: boolean
paginationData?: PageDataResourceGroups
@@ -24,7 +25,10 @@ const emit = defineEmits(['mounted', 'move', 'arrowClick'])
// Splide 화살표 로직을 위한 composable 사용
const { addArrowClickListeners } = useSplideArrow()
const isMultipleItems = computed(() => (props.slideItemLength ?? 0) > 1)
const perPage = computed(() => props.perPage ?? 1)
const isMultipleItems = computed(
() => (props.slideItemLength ?? 0) > perPage.value
)
const resolvedType = computed<ResponsiveOptions['type']>(() => {
if (props.type) return props.type
return isMultipleItems.value ? 'loop' : 'slide'
@@ -35,6 +39,7 @@ const options = computed((): ResponsiveOptions => {
type: resolvedType.value,
autoWidth: true,
autoHeight: true,
perPage: perPage.value,
speed: 500,
updateOnMove: true,
autoplay: props.autoplay,