From 418adfec17c8d8c594ad28e7b06229925b880764 Mon Sep 17 00:00:00 2001 From: clkim Date: Mon, 8 Dec 2025 18:37:02 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20[PWT-169]=20=EC=82=AC=EC=A0=84=20?= =?UTF-8?q?=EB=93=B1=EB=A1=9D=20>=20=EA=B8=B0=EA=B8=B0=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC=20=EC=97=86=EC=9D=B4=20=EC=8A=A4=ED=86=A0=EB=B8=8C=20?= =?UTF-8?q?=EC=95=B1=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EB=B2=84?= =?UTF-8?q?=ED=8A=BC=20=EB=85=B8=EC=B6=9C=EB=90=98=EB=8A=94=20=ED=98=84?= =?UTF-8?q?=EC=83=81=20=EB=AC=B8=EC=9D=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- layers/components/layouts/EventNavigation.vue | 2 +- layers/components/layouts/Header.vue | 195 ++++++++++-------- layers/components/widgets/modal/Preregist.vue | 15 +- layers/stores/usePageDataStore.ts | 6 + layers/templates/FxPreregist01/index.vue | 5 +- layers/utils/dataUtil.ts | 14 +- layers/utils/formatUtil.ts | 9 - 7 files changed, 127 insertions(+), 119 deletions(-) diff --git a/layers/components/layouts/EventNavigation.vue b/layers/components/layouts/EventNavigation.vue index e7a2ff1..a23d757 100644 --- a/layers/components/layouts/EventNavigation.vue +++ b/layers/components/layouts/EventNavigation.vue @@ -27,10 +27,10 @@ const getEventNavigation = async (): Promise(null) @@ -48,45 +50,29 @@ const hasGnbMenus = computed(() => { return Object.keys(menus).length > 0 }) +const currentPath = computed(() => formatPathWithoutLocale(route.path)) const gnb1depthButtonData = computed( () => gnbData.value?.buttons[0]?.button_json as GameDataResourceGroup ) const gnb2depthButtonData = computed( () => gnbData.value?.buttons[1]?.button_json as GameDataResourceGroupSet ) -const currentPath = computed(() => formatPathWithoutLocale(route.path)) const supportedPlatforms = computed( () => - getSupportedPlatforms(gameData.value?.os_type, { - platformType: gameData.value?.platform_type, - }) as PlatformTransformType[] + getSupportedPlatforms( + gameData.value?.os_type, + gameData.value?.platform_type + ) as PlatformTransformType[] ) -const pathMatches = (base: string, current: string) => { - if (!base || base === '/') return current === '/' - return current === base -} - -/** 자식 중 활성 링크 존재 여부 */ +// 자식 중 활성 링크 존재 여부 확인 const hasActiveChild = (children?: GameDataMenuChildren) => { - const cur = currentPath.value return formatToArray(children).some(child => { - if (!child?.url_path || !isInternalUrl(child.url_path)) return false - return pathMatches(formatPathWithoutLocale(child.url_path), cur) + if (!child?.url_path || child.click_action_type === 2) return false + return formatPathWithoutLocale(child.url_path) === currentPath.value }) } -/** 1Depth 활성화 여부 */ -const isNavItemActive = (gnbItem: GameDataMenu): boolean => { - const cur = currentPath.value - const base = gnbItem?.url_path - const selfActive = - !!base && - isInternalUrl(base) && - pathMatches(formatPathWithoutLocale(base), cur) - return selfActive || hasActiveChild(gnbItem.children) -} - // navAreaRef의 넓이를 구하는 함수 const calculateNavWidth = () => { if (!import.meta.client) return @@ -158,7 +144,9 @@ const handleMenuOpen = () => { scrollStore.controlScrollLock(true) } -const handleMenuClose = () => { +const handleMenuClose = (isPassing: boolean = false) => { + if (isPassing) return + isMenuOpen.value = false scrollStore.controlScrollLock(false) } @@ -198,7 +186,7 @@ const showNotSupportedOSAlert = () => { } const handleStartClick = () => { - if (breakpoints.value.isDesktop) return + if (device.isDesktop) return const target = device.isAndroid ? 'google_play' @@ -259,7 +247,7 @@ onMounted(() => {