fix. gnb 2depth 정확히 일치하는 경우만 1depth 활성화 되도록 수정

This commit is contained in:
clkim
2025-11-19 16:13:02 +09:00
parent dc3d0083fc
commit 1596f874ff
2 changed files with 55 additions and 52 deletions

View File

@@ -3,39 +3,47 @@
<LayoutsStoveHeader />
<Transition name="fade">
<div v-if="!isLoading" class="flex-1 flex items-center justify-center p-25">
<div
v-if="!isLoading"
class="flex-1 flex items-center justify-center p-25"
>
<div class="flex flex-col items-center gap-6 w-full">
<!-- Stove Logo -->
<div class="flex items-center justify-center h-7">
<img
src="/images/common/logo-stove.svg"
alt="Stove"
class="h-full w-auto"
/>
</div>
<!-- Error Icon and Text -->
<div class="flex flex-col items-center gap-4 w-full">
<!-- Error Icon -->
<div class="flex items-center justify-center">
<img
src="/images/common/img_error.png"
alt="Error"
class="w-40 h-40 md:w-60 md:h-60"
<!-- Stove Logo -->
<div class="flex items-center justify-center h-7">
<img
src="/images/common/logo-stove.svg"
alt="Stove"
class="h-full w-auto"
/>
</div>
<!-- Error Text -->
<div class="flex flex-col items-center gap-2 w-full">
<h1 class="font-medium text-xl md:text-2xl leading-[1.5] tracking-[-0.03em] text-center text-[#1F1F1F] m-0">
<span v-dompurify-html="errorTitle"></span>
</h1>
<p v-dompurify-html="errorMsg" class="font-normal text-sm md:text-base leading-[1.7] md:leading-[1.625] tracking-[-0.03em] text-center text-[#666666] m-0"></p>
</div>
</div>
<!-- Error Icon and Text -->
<div class="flex flex-col items-center gap-4 w-full">
<!-- Error Icon -->
<div class="flex items-center justify-center">
<img
src="/images/common/img_error.png"
alt="Error"
class="w-40 h-40 md:w-60 md:h-60"
/>
</div>
<!-- Home Button -->
<AtomsButton
<!-- Error Text -->
<div class="flex flex-col items-center gap-2 w-full">
<h1
class="font-medium text-xl md:text-2xl leading-[1.5] tracking-[-0.03em] text-center text-[#1F1F1F] m-0"
>
<span v-dompurify-html="errorTitle"></span>
</h1>
<p
v-dompurify-html="errorMsg"
class="font-normal text-sm md:text-base leading-[1.7] md:leading-[1.625] tracking-[-0.03em] text-center text-[#666666] m-0"
></p>
</div>
</div>
<!-- Home Button -->
<AtomsButton
type="action"
button-size="size-small md:size-large"
background-color="#FC4420"
@@ -50,7 +58,6 @@
</div>
</template>
<script setup lang="ts">
interface ErrorProps {
error?: {
@@ -62,7 +69,7 @@ interface ErrorProps {
const { tm } = useI18n()
const props = withDefaults(defineProps<ErrorProps>(), {
error: () => ({})
error: () => ({}),
})
const nuxtError = useError()
const currentError = computed(() => props.error || nuxtError.value)
@@ -72,13 +79,12 @@ const isLoading = ref(true)
const errorTitle = ref('')
const errorMsg = ref('')
//error clear 함수 생성
//error clear 함수 생성
const localePath = useLocalePath()
// const handleError = () => clearError({ redirect: '/' })
const handleError = () => {
window.location.href = localePath('/')
// clearError({ redirect: `${localePath('/brand')}` })
}
const handleBack = () => {
// 에러 상태를 클리어하고 이전 페이지로 이동
@@ -90,15 +96,16 @@ const handleBack = () => {
// 백스페이스 키 처리
const handleKeydown = (e: KeyboardEvent) => {
if (e.key === 'Backspace' &&
!['INPUT', 'TEXTAREA'].includes((e.target as HTMLElement).tagName)) {
if (
e.key === 'Backspace' &&
!['INPUT', 'TEXTAREA'].includes((e.target as HTMLElement).tagName)
) {
e.preventDefault()
handleBack()
}
}
// 500 에러 발생 시 /error 페이지로 리다이렉트
onMounted(() => {
const statusCode = currentError.value?.statusCode
if (statusCode === 500) {
@@ -108,19 +115,16 @@ onMounted(() => {
errorTitle.value = tm('Error_404_Not_Found')
errorMsg.value = tm('Error_404_Not_Found2')
}
nextTick(() => {
isLoading.value = false
})
window.addEventListener('keydown', handleKeydown)
window.addEventListener('popstate', handleBack)
})
onUnmounted(() => {
window.removeEventListener('keydown', handleKeydown)
window.removeEventListener('popstate', handleBack)
})
</script>
</script>