Files
web-temp/layers/components/blocks/StoveGnb.vue
clkim 02ef9f9aa5 refactor. 게임 데이터 관련 상태 및 메타 태그 처리 개선
- 게임 데이터 스토어에서 상태 변수 이름 변경 및 추가
- 메타 태그 및 스타일 링크 생성 로직 간소화
- 코드 가독성 향상을 위한 함수 인자 제거
2026-03-18 16:35:27 +09:00

64 lines
1.6 KiB
Vue

<script setup lang="ts">
let mountedInstance: any = null
onMounted(() => {
const gameDataStore = useGameDataStore()
const { stoveGnbJson, defaultLangCode, langCodes, gameTheme } =
storeToRefs(gameDataStore)
const currentDomain =
window.location.protocol + '//' + window.location.hostname
if (typeof window !== 'undefined' && (window as any).StoveGnb) {
const stoveGnbOptions = {
logArea: currentDomain,
useLanguageCodeFromPath: true,
serviceTitle: {
pc: '',
mobile: '',
},
widget: {
notification: stoveGnbJson.value?.notify_icon_visible ?? true,
stoveDownload: stoveGnbJson.value?.stove_install_button_visible ?? true,
languageSelect: false,
themeSelect: false,
stoveMenu: {
active: false,
mobile: true,
},
},
global: {
languageCoverages: langCodes.value,
defaultSelectedLanguage: defaultLangCode.value ?? 'ko',
},
loginMethod: {
redirectCurrentPage: true,
},
mode: {
theme: {
support: [gameTheme.value],
default: gameTheme.value,
},
mini: true,
layout: 'wide',
fixed: false,
},
}
mountedInstance = (window as any).StoveGnb.mount(
'#stove-wrap',
stoveGnbOptions
)
}
})
onBeforeUnmount(() => {
if (mountedInstance && typeof mountedInstance.destroy === 'function') {
mountedInstance.destroy()
}
mountedInstance = null
})
</script>
<template>
<div id="stove-wrap" class="relative h-[48px] z-[5]" />
</template>