fix. gnb 수정
This commit is contained in:
@@ -35,10 +35,10 @@ const officialItemWidths = ref<number[]>([])
|
||||
const overflowCount = ref<number>(0)
|
||||
|
||||
const gnbData = computed(() => gameData.value?.gnb)
|
||||
const hasGnbMenus = computed(() => {
|
||||
const gnbMenusCount = computed(() => {
|
||||
const menus = gnbData.value?.menus
|
||||
if (!menus || typeof menus !== 'object') return false
|
||||
return Object.keys(menus).length > 0
|
||||
if (!menus || typeof menus !== 'object') return 0
|
||||
return Object.keys(menus).length
|
||||
})
|
||||
const currentPath = computed(() => formatPathWithoutLocale(route.path))
|
||||
const start1depthData = computed(
|
||||
@@ -48,8 +48,6 @@ const start2depthData = computed(
|
||||
() => gnbData.value?.buttons[1]?.button_json as GameDataResourceGroupSet
|
||||
)
|
||||
|
||||
console.log('start2depthData', start2depthData.value)
|
||||
|
||||
// 자식 중 활성 링크 존재 여부 확인
|
||||
const hasActiveChild = (children?: GameDataMenuChildren) => {
|
||||
return formatToArray(children).some(child => {
|
||||
@@ -198,7 +196,7 @@ onMounted(() => {
|
||||
</AtomsLocaleLink>
|
||||
</div>
|
||||
<nav :class="['nav-list', { 'is-mounted': isMounted }]">
|
||||
<template v-if="hasGnbMenus">
|
||||
<template v-if="gnbMenusCount > 0">
|
||||
<div class="official custom-theme-scrollbar">
|
||||
<div
|
||||
v-for="(gnbItem, key) in gnbData?.menus"
|
||||
@@ -208,8 +206,7 @@ onMounted(() => {
|
||||
'is-hidden':
|
||||
breakpoints.isDesktop &&
|
||||
overflowCount > 0 &&
|
||||
Number(key) >=
|
||||
Object.keys(gnbData?.menus).length - overflowCount,
|
||||
Number(key) > gnbMenusCount - overflowCount,
|
||||
}"
|
||||
>
|
||||
<component
|
||||
@@ -278,8 +275,7 @@ onMounted(() => {
|
||||
'is-hidden':
|
||||
breakpoints.isDesktop &&
|
||||
overflowCount > 0 &&
|
||||
Number(key) >=
|
||||
Object.keys(gnbData?.menus).length - overflowCount,
|
||||
Number(key) <= gnbMenusCount - overflowCount,
|
||||
}"
|
||||
>
|
||||
<component
|
||||
|
||||
Reference in New Issue
Block a user