fix. Splide 최적화

This commit is contained in:
clkim
2025-12-18 14:32:40 +09:00
parent 78ce718f72
commit 6d93bebd8b
5 changed files with 17 additions and 16 deletions

View File

@@ -3,11 +3,13 @@ interface Props {
src: string | { pc?: string; mo?: string }
alt?: string
imageType?: 'common' | 'game'
priority?: 'high' | 'low' | 'auto'
}
const props = withDefaults(defineProps<Props>(), {
alt: 'image',
imageType: 'game',
priority: 'auto',
})
const isResponsiveMode = computed(() => {
@@ -45,9 +47,9 @@ const imagePaths = computed(() => {
:src="imagePaths.pc"
:alt="alt"
v-bind="$attrs"
loading="lazy"
:loading="priority === 'high' ? 'eager' : 'lazy'"
decoding="async"
fetchpriority="auto"
:fetchpriority="priority"
/>
</picture>
@@ -56,8 +58,8 @@ const imagePaths = computed(() => {
:src="imagePaths.mo"
:alt="alt"
v-bind="$attrs"
loading="lazy"
:loading="priority === 'high' ? 'eager' : 'lazy'"
decoding="async"
fetchpriority="auto"
:fetchpriority="priority"
/>
</template>

View File

@@ -45,6 +45,7 @@ const options = computed((): ResponsiveOptions => {
arrows: props.arrows,
pagination: props.pagination,
flickPower: 300,
lazyLoad: 'nearby',
classes: {
pagination: 'splide-pagination-bullets type-full',
page: 'splide-pagination-bullet',

View File

@@ -51,6 +51,8 @@ const mainOptions = computed<Options>(() => ({
arrows: false,
pagination: false,
drag: props.drag,
updateOnMove: true,
lazyLoad: 'nearby', // 성능 최적화: 이미지 지연 로딩
}))
const thumbOptions = computed<Options>(() => ({