64 lines
1.7 KiB
Vue
64 lines
1.7 KiB
Vue
<template>
|
|
<NuxtLayout>
|
|
<h1 class="sr-only">dddd</h1>
|
|
<NuxtPage />
|
|
|
|
<MoleculesLoadingFull />
|
|
<MoleculesLoadingLocal />
|
|
</NuxtLayout>
|
|
</template>
|
|
|
|
<script setup lang="ts">
|
|
import { useNuxtApp } from 'nuxt/app'
|
|
import MoleculesLoadingFull from '#layers/components/molecules/loading/Full.vue'
|
|
import MoleculesLoadingLocal from '#layers/components/molecules/loading/Local.vue'
|
|
import { useGameDataStore } from '#layers/stores/useGameDataStore'
|
|
import type { GameDataMetaTag, GameDataValue } from '#layers/types/api/gameData'
|
|
|
|
const nuxtApp = useNuxtApp()
|
|
const getGameData = ref<GameDataValue | null>(null)
|
|
const metaData = ref<GameDataMetaTag | null>(null)
|
|
const { setGameData } = useGameDataStore()
|
|
|
|
// SSR에서만 접근 가능
|
|
const gameDataFromServer = import.meta.server
|
|
? nuxtApp.ssrContext?.event.context.gameData
|
|
: null
|
|
|
|
if (gameDataFromServer) {
|
|
getGameData.value = gameDataFromServer
|
|
setGameData(gameDataFromServer)
|
|
}
|
|
|
|
const meta = gameDataFromServer?.meta_tag ?? null
|
|
const theme = gameDataFromServer?.design_theme === 1 ? 'dark' : 'light'
|
|
|
|
if (gameDataFromServer && meta) {
|
|
metaData.value = meta
|
|
useSeoMeta({
|
|
title: meta.page_title,
|
|
description: meta.page_desc,
|
|
ogTitle: meta.og_title,
|
|
ogImage: meta.og_image,
|
|
ogDescription: meta.og_desc,
|
|
ogUrl: meta.og_url,
|
|
twitterImage: meta.x_image,
|
|
twitterTitle: meta.x_title,
|
|
twitterDescription: meta.x_desc,
|
|
})
|
|
useHead({
|
|
htmlAttrs: {
|
|
'data-game': gameDataFromServer.game_name || '',
|
|
'data-theme': theme || '',
|
|
lang: gameDataFromServer.default_lang_code,
|
|
},
|
|
//meta: [...(updatedMetaTags.value || [])],
|
|
//link: [...(links.value || [])]
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
@import '#layers/assets/css/app.css';
|
|
</style>
|