fix. Splide 최적화
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -51,6 +51,8 @@ const mainOptions = computed<Options>(() => ({
|
||||
arrows: false,
|
||||
pagination: false,
|
||||
drag: props.drag,
|
||||
updateOnMove: true,
|
||||
lazyLoad: 'nearby', // 성능 최적화: 이미지 지연 로딩
|
||||
}))
|
||||
|
||||
const thumbOptions = computed<Options>(() => ({
|
||||
|
||||
Reference in New Issue
Block a user