fix. 공통 함수, 샘플 이미지 수정
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user