fix. [SWV-809] BI 이미지 위치 통합 코드 적용
This commit is contained in:
@@ -20,7 +20,7 @@ const scrollStore = useScrollStore()
|
||||
const breakpoints = useResponsiveBreakpoints()
|
||||
const { sendLog } = useAnalytics()
|
||||
|
||||
const { gameData } = storeToRefs(gameDataStore)
|
||||
const { gameName, imgJson, gnb, eventBanner } = storeToRefs(gameDataStore)
|
||||
const { pageLayoutType } = storeToRefs(pageDataStore)
|
||||
const { isPassedStoveGnb } = storeToRefs(scrollStore)
|
||||
|
||||
@@ -35,18 +35,18 @@ const navWidth = ref(0)
|
||||
const officialItemWidths = ref<number[]>([])
|
||||
const overflowCount = ref<number>(0)
|
||||
|
||||
const gnbData = computed(() => gameData.value?.gnb)
|
||||
const biSmallPath = computed(() => imgJson.value?.bi_small)
|
||||
const gnbMenusCount = computed(() => {
|
||||
const menus = gnbData.value?.menus
|
||||
const menus = gnb.value?.menus
|
||||
if (!menus || typeof menus !== 'object') return 0
|
||||
return Object.keys(menus).length
|
||||
})
|
||||
const currentPath = computed(() => formatPathWithoutLocale(route.path))
|
||||
const start1depthData = computed(
|
||||
() => gnbData.value?.buttons[0]?.button_json as GameDataResourceGroup
|
||||
() => gnb.value?.buttons[0]?.button_json as GameDataResourceGroup
|
||||
)
|
||||
const start2depthData = computed(
|
||||
() => gnbData.value?.buttons[1]?.button_json as GameDataResourceGroupSet
|
||||
() => gnb.value?.buttons[1]?.button_json as GameDataResourceGroupSet
|
||||
)
|
||||
|
||||
// 자식 중 활성 링크 존재 여부 확인
|
||||
@@ -60,7 +60,7 @@ const hasActiveChild = (children?: GameDataMenuChildren) => {
|
||||
// navAreaRef의 넓이를 구하는 함수
|
||||
const calculateNavWidth = () => {
|
||||
if (!import.meta.client) return
|
||||
if (!navAreaRef.value || !gnbData.value) return 0
|
||||
if (!navAreaRef.value || !gnb.value) return 0
|
||||
|
||||
const navAreaWidth = navAreaRef.value.offsetWidth
|
||||
navWidth.value = navAreaWidth + MORE_WIDTH
|
||||
@@ -179,20 +179,17 @@ onMounted(() => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<header :class="['header', { 'empty-game': !gnbData }]">
|
||||
<header :class="['header', { 'empty-game': !gnb }]">
|
||||
<BlocksStoveGnb class="h-[48px]" />
|
||||
<div
|
||||
v-if="gnbData"
|
||||
:class="['game-wrap', { 'is-fixed': isPassedStoveGnb }]"
|
||||
>
|
||||
<div v-if="gnb" :class="['game-wrap', { 'is-fixed': isPassedStoveGnb }]">
|
||||
<AtomsLocaleLink
|
||||
to="/home"
|
||||
class="mx-auto md:hidden"
|
||||
@click="handleSendLog('BI')"
|
||||
>
|
||||
<img
|
||||
:src="formatPathHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
:src="formatPathHost(biSmallPath)"
|
||||
:alt="gameName"
|
||||
class="h-[30px]"
|
||||
/>
|
||||
</AtomsLocaleLink>
|
||||
@@ -211,8 +208,8 @@ onMounted(() => {
|
||||
@click="[handleMenuClose(), handleSendLog('BI')]"
|
||||
>
|
||||
<img
|
||||
:src="formatPathHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
:src="formatPathHost(biSmallPath)"
|
||||
:alt="gameName"
|
||||
class="h-[30px]"
|
||||
/>
|
||||
</AtomsLocaleLink>
|
||||
@@ -221,7 +218,7 @@ onMounted(() => {
|
||||
<template v-if="gnbMenusCount > 0">
|
||||
<div class="official custom-theme-scrollbar">
|
||||
<div
|
||||
v-for="(gnbItem, key) in gnbData?.menus"
|
||||
v-for="(gnbItem, key) in gnb?.menus"
|
||||
:key="key"
|
||||
class="nav-item group"
|
||||
:class="{
|
||||
@@ -291,7 +288,7 @@ onMounted(() => {
|
||||
<div class="more-list">
|
||||
<div class="list-inner">
|
||||
<div
|
||||
v-for="(gnbItem, key) in gnbData?.menus"
|
||||
v-for="(gnbItem, key) in gnb?.menus"
|
||||
:key="key"
|
||||
:class="{
|
||||
'is-hidden':
|
||||
@@ -349,15 +346,11 @@ onMounted(() => {
|
||||
</div>
|
||||
</template>
|
||||
<ClientOnly>
|
||||
<div v-if="gameData?.event_banner" class="event">
|
||||
<div v-if="eventBanner" class="event">
|
||||
<div class="nav-item">
|
||||
<AtomsLocaleLink
|
||||
:to="gameData?.event_banner?.page_url"
|
||||
:target="
|
||||
gameData?.event_banner?.link_type === 1
|
||||
? '_self'
|
||||
: '_blank'
|
||||
"
|
||||
:to="eventBanner?.page_url"
|
||||
:target="eventBanner?.link_type === 1 ? '_self' : '_blank'"
|
||||
:class="[
|
||||
'nav-1depth',
|
||||
{ 'router-link-active': pageLayoutType === 'promotion' },
|
||||
|
||||
@@ -21,6 +21,7 @@ const { locale } = useI18n()
|
||||
const { urlJson } = storeToRefs(gameDataStore)
|
||||
const { pageData } = storeToRefs(pageDataStore)
|
||||
|
||||
const communityUrl = computed(() => urlJson.value?.community)
|
||||
const boardId = computed(
|
||||
() => getComponentGroup(props.components, 'boardId')?.display?.text
|
||||
)
|
||||
@@ -101,11 +102,10 @@ const splideOptions = computed(() => {
|
||||
})
|
||||
|
||||
const getArticleUrl = (articleId: string) => {
|
||||
const communityUrl = urlJson.value?.community
|
||||
if (!communityUrl || !articleId || !boardId.value) {
|
||||
if (!communityUrl.value || !articleId || !boardId.value) {
|
||||
return ''
|
||||
}
|
||||
return `${communityUrl}/view/${articleId}`
|
||||
return `${communityUrl.value}/view/${articleId}`
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user