fix. gameData 개별 속성 구조분해
This commit is contained in:
@@ -8,7 +8,7 @@ const gameDataStore = useGameDataStore()
|
||||
const modalStore = useModalStore()
|
||||
const { sendLog } = useAnalytics()
|
||||
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
const { gameData, snsJson } = storeToRefs(gameDataStore)
|
||||
const { handleOpenToast } = modalStore
|
||||
|
||||
const analytics = {
|
||||
@@ -22,9 +22,6 @@ const snsBackgroundColor = computed(() => {
|
||||
const colorCode = getColorCodeFromData(colorData, 'none')
|
||||
return colorCode
|
||||
})
|
||||
const snsList = computed(() => {
|
||||
return gameData.value?.sns_json
|
||||
})
|
||||
|
||||
const handleControlForce = (state: boolean) => {
|
||||
showSnsList.value = state
|
||||
@@ -45,7 +42,7 @@ const handleCopy = async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div v-if="Object.keys(snsList).length > 0" class="sns-container">
|
||||
<div v-if="Object.keys(snsJson).length > 0" class="sns-container">
|
||||
<transition name="fade">
|
||||
<AtomsButtonCircle
|
||||
v-show="!showSnsList"
|
||||
@@ -63,7 +60,7 @@ const handleCopy = async () => {
|
||||
class="sns-list"
|
||||
:style="{ backgroundColor: snsBackgroundColor }"
|
||||
>
|
||||
<template v-for="(item, key) in snsList" :key="key">
|
||||
<template v-for="(item, key) in snsJson" :key="key">
|
||||
<a
|
||||
v-if="item.use_yn === 1 && item.url"
|
||||
:href="item.url"
|
||||
|
||||
@@ -26,12 +26,12 @@ const {
|
||||
setPreregist,
|
||||
} = usePreregist()
|
||||
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
const { gameId, gameName } = storeToRefs(gameDataStore)
|
||||
const { sendLog } = useAnalytics()
|
||||
|
||||
// Constants
|
||||
const stoveCs = runtimeConfig.public.stoveCs
|
||||
const customerServiceUrl = `${stoveCs}/${gameData.value?.game_id}`
|
||||
const customerServiceUrl = `${stoveCs}/${gameId.value}`
|
||||
|
||||
/**
|
||||
* 번역 함수 (Props로 전달받은 tm 또는 key 반환)
|
||||
@@ -57,8 +57,7 @@ const errorMessages = computed<Record<number, string>>(() => ({
|
||||
const tmWithGameName = (key: string): string => {
|
||||
const text = tm(key)
|
||||
if (typeof text === 'string' && text.includes('%게임명%')) {
|
||||
const gameName = gameData.value?.game_name ?? ''
|
||||
return text.replace(/%게임명%/g, gameName)
|
||||
return text.replace(/%게임명%/g, gameName.value)
|
||||
}
|
||||
return text
|
||||
}
|
||||
@@ -375,7 +374,7 @@ defineExpose({
|
||||
<h3
|
||||
class="text-xl font-bold leading-[30px] tracking-[-0.6px] text-[#ebebeb] md:text-2xl md:leading-[34px] md:tracking-[-0.72px]"
|
||||
>
|
||||
{{ gameData?.game_name }}
|
||||
{{ gameName }}
|
||||
</h3>
|
||||
<p
|
||||
class="text-[13px] font-normal leading-[22px] tracking-[-0.325px] text-[#ebebeb] md:text-[15px] md:leading-6 md:tracking-[-0.45px]"
|
||||
|
||||
Reference in New Issue
Block a user