fix. 코드 경고 수정
This commit is contained in:
22
app/app.vue
22
app/app.vue
@@ -7,11 +7,11 @@ import type {
|
||||
} from '#layers/types/api/gameData'
|
||||
|
||||
const nuxtApp = useNuxtApp()
|
||||
const { locale } = useI18n()
|
||||
|
||||
const gameDataStore = useGameDataStore()
|
||||
const modalStore = useModalStore()
|
||||
const scrollStore = useScrollStore()
|
||||
const { locale } = useI18n()
|
||||
|
||||
const { setGameData } = gameDataStore
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
@@ -111,24 +111,11 @@ if (serverGameData) {
|
||||
setupMetaData(serverGameData)
|
||||
}
|
||||
|
||||
// Google Analytics 설정 (클라이언트에서만 실행)
|
||||
if (import.meta.client) {
|
||||
const { gtag, initialize } = useGtag()
|
||||
initialize(gameData.value?.ga_code)
|
||||
gtag('event', 'screen_view', {
|
||||
app_name: 'My App',
|
||||
screen_name: 'Home',
|
||||
})
|
||||
}
|
||||
|
||||
let rafId: number | null = null
|
||||
let stopWatch: (() => void) | null = null
|
||||
|
||||
onMounted(() => {
|
||||
if (!import.meta.client) return
|
||||
|
||||
useEventListener('scroll', scrollStore.updateScrollValue, { passive: true })
|
||||
|
||||
stopWatch = watch(
|
||||
scrollGnbPosition,
|
||||
newValue => {
|
||||
@@ -145,6 +132,13 @@ onMounted(() => {
|
||||
},
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
const { gtag, initialize } = useGtag()
|
||||
initialize(gameData.value?.ga_code)
|
||||
gtag('event', 'screen_view', {
|
||||
app_name: 'My App',
|
||||
screen_name: 'Home',
|
||||
})
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
|
||||
Reference in New Issue
Block a user