fix. utils 함수 리팩토링

This commit is contained in:
clkim
2025-12-01 14:23:35 +09:00
parent 10ce30e149
commit 9b3b7b4ee3
20 changed files with 120 additions and 162 deletions

View File

@@ -155,7 +155,7 @@ const handleMoveFocus = (target: 'pc' | 'mobile') => {
>
<img
:src="
getResourceHost('/images/common/img_desktop.png', {
formatPathHost('/images/common/img_desktop.png', {
imageType: 'common',
})
"
@@ -410,7 +410,7 @@ const handleMoveFocus = (target: 'pc' | 'mobile') => {
<div class="flex items-center justify-center w-full">
<img
:src="
getResourceHost(
formatPathHost(
`/images/common/grades_driver/Type-${driver.driverCode}.svg`,
{ imageType: 'common' }
)

View File

@@ -240,7 +240,7 @@ const handlePreregistClick = () => {
<div class="flex flex-col gap-4 mt-8 md:flex-row">
<div v-if="preImgPreregistdData" class="w-full max-w-[446px]">
<AtomsImg
:src="getImagePaths(preImgPreregistdData)"
:src="getResourceSrc(preImgPreregistdData)"
:alt="preImgPreregistdData?.display?.text"
loading="lazy"
decoding="async"
@@ -249,7 +249,7 @@ const handlePreregistClick = () => {
</div>
<div v-if="preImgSnsData" class="relative w-full max-w-[446px]">
<AtomsImg
:src="getImagePaths(preImgSnsData)"
:src="getResourceSrc(preImgSnsData)"
:alt="preImgSnsData?.display?.text"
loading="lazy"
decoding="async"
@@ -266,7 +266,7 @@ const handlePreregistClick = () => {
>
<a :href="btn.link" target="_blank" rel="noopener noreferrer">
<AtomsImg
:src="getImagePaths(btn.image)"
:src="getResourceSrc(btn.image)"
:alt="btn.image?.display?.text"
/>
</a>
@@ -361,7 +361,7 @@ const handlePreregistClick = () => {
>
<AtomsImg
:src="
getImagePaths(
getResourceSrc(
item.flagType === 1 ? item.incomplete : item.default
)
"

View File

@@ -232,7 +232,7 @@ onMounted(() => {
>
<img
:src="
getResourceHost(card.benefitIcon, { imageType: 'common' })
formatPathHost(card.benefitIcon, { imageType: 'common' })
"
:alt="card.benefitTitle"
class="w-[48px] h-[48px] object-contain rounded-2xl"

View File

@@ -46,8 +46,8 @@ const buttonListData = computed(() => {
<div v-if="imgListData" class="img-container">
<div v-for="(item, index) in imgListData" :key="index" class="img-item">
<AtomsImg
v-if="getImagePaths(item)"
:src="getImagePaths(item)"
v-if="getResourceSrc(item)"
:src="getResourceSrc(item)"
:alt="item?.display?.text"
class="w-full object-contain"
/>

View File

@@ -5,7 +5,7 @@ import {
getComponentGroup,
getComponentContainer,
} from '#layers/utils/dataUtil'
import { getResourceHost } from '#layers/utils/styleUtil'
import type { PageDataTemplateComponents } from '#layers/types/api/pageData'
import type { OperateGroupItem } from '#layers/types/api/operateResources'
@@ -118,7 +118,7 @@ const onArrowClick = direction => {
<BlocksCardNews
:title="item.title"
:description="globalDateFormat(item.reg_dt, locale)"
:img-path="getResourceHost(item.img_path)"
:img-path="formatPathHost(item.img_path)"
:url="item.url"
:link-target="item.link_target"
class="slide-inner"