fix: 클라이언트 전용 코드로 변경하여 서버 사이드 렌더링 지원
This commit is contained in:
@@ -52,6 +52,8 @@ const pathMatches = (base: string, current: string) => {
|
||||
|
||||
/** 자식 중 활성 링크 존재 여부 */
|
||||
const hasActiveChild = (children?: GameDataMenuChildren) => {
|
||||
if(!import.meta.client) return false
|
||||
|
||||
const cur = currentPath.value
|
||||
return formatToArray(children).some(child => {
|
||||
if (!child?.url_path || !isInternalUrl(child.url_path)) return false
|
||||
@@ -61,6 +63,8 @@ const hasActiveChild = (children?: GameDataMenuChildren) => {
|
||||
|
||||
/** 1Depth 활성화 여부 */
|
||||
const isNavItemActive = (gnbItem: GameDataMenu): boolean => {
|
||||
if(!import.meta.client) return false
|
||||
|
||||
const cur = currentPath.value
|
||||
const base = gnbItem?.url_path
|
||||
const selfActive =
|
||||
@@ -241,13 +245,13 @@ onBeforeUnmount(() => {
|
||||
<header class="header">
|
||||
<BlocksStoveGnbNew class="h-[48px]" />
|
||||
<div :class="['game-wrap', { 'is-fixed': isPassedStoveGnb }]">
|
||||
<AtomsLocaleLink to="/brand" class="mx-auto md:hidden">
|
||||
<NuxtLinkLocale to="/brand" class="mx-auto md:hidden router-link-active router-link-exact-active">
|
||||
<img
|
||||
:src="getImageHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
class="h-[30px]"
|
||||
/>
|
||||
</AtomsLocaleLink>
|
||||
</NuxtLinkLocale>
|
||||
<button class="btn-open" @click="handleMenuOpen">
|
||||
<AtomsIconsMenuBoldLine class="mx-auto" />
|
||||
<span class="sr-only">menu open</span>
|
||||
@@ -255,13 +259,13 @@ onBeforeUnmount(() => {
|
||||
<div :class="['nav-wrap', { 'is-open': isMenuOpen }]">
|
||||
<div ref="navAreaRef" class="nav-area">
|
||||
<div class="nav-logo">
|
||||
<AtomsLocaleLink to="/brand" @click="handleMenuClose">
|
||||
<NuxtLinkLocale to="/brand" class="router-link-active router-link-exact-active" @click="handleMenuClose">
|
||||
<img
|
||||
:src="getImageHost(gnbData?.bi_path)"
|
||||
:alt="gameData?.game_name"
|
||||
class="h-[30px]"
|
||||
/>
|
||||
</AtomsLocaleLink>
|
||||
</NuxtLinkLocale>
|
||||
</div>
|
||||
<nav class="nav-list">
|
||||
<div v-if="gnbData?.menus" class="official">
|
||||
|
||||
Reference in New Issue
Block a user