fix. 페이지네이션 스타일 적용

This commit is contained in:
clkim
2025-10-21 19:59:25 +09:00
parent 118bec5dde
commit c9c39a06dd
15 changed files with 117 additions and 64 deletions

View File

@@ -15,7 +15,7 @@ interface Props {
const props = defineProps<Props>()
const splideRef = ref<SplideSlide | null>(null)
const currentSlide = ref<number | null>(null)
const currentSlideIndex = ref<number | null>(null)
const slideData = computed(() => {
return getComponentContainer(props.components, 'group_sets', { maxLength: 5 })
@@ -32,11 +32,11 @@ const goToSlide = (index: number) => {
}
const handleSplideMounted = (splide: SplideType) => {
currentSlide.value = splide.index
currentSlideIndex.value = splide.index
}
const changeCurrentSlide = (_splide: SplideType, newIndex: number) => {
currentSlide.value = newIndex
const handleSplideMove = (_splide: SplideType, newIndex: number) => {
currentSlideIndex.value = newIndex
}
</script>
@@ -50,8 +50,8 @@ const changeCurrentSlide = (_splide: SplideType, newIndex: number) => {
:arrows="false"
:pagination="false"
class="h-full"
@splide:move="changeCurrentSlide"
@splide:mounted="handleSplideMounted"
@move="handleSplideMove"
@mounted="handleSplideMounted"
>
<SplideSlide v-for="(item, index) in slideData" :key="index">
<WidgetsBackground
@@ -72,7 +72,7 @@ const changeCurrentSlide = (_splide: SplideType, newIndex: number) => {
<WidgetsDescription
v-if="hasComponentGroup(item, 'description')"
:resources-data="getComponentGroup(item, 'description')"
class="description-lg mt-4 md:mt-6"
class="mt-4 md:mt-6"
/>
</div>
</SplideSlide>
@@ -88,13 +88,16 @@ const changeCurrentSlide = (_splide: SplideType, newIndex: number) => {
:class="[
'pagination-item',
{
'is-active': currentSlide === index,
'is-completed': index < currentSlide,
'is-active': currentSlideIndex === index,
'is-completed': index < currentSlideIndex,
},
]"
>
<button
:class="['btn-pagination', { 'is-active': currentSlide === index }]"
:class="[
'btn-pagination',
{ 'is-active': currentSlideIndex === index },
]"
@click="goToSlide(index)"
>
<span class="item-bullet"></span>