From 4698efc22543443557b64e1145317a7bf1e3e513 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Chyeonggkim=E2=80=9D?= <“hyeonggkim@smilegate.com”> Date: Wed, 12 Nov 2025 13:37:46 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=B0=B1=EC=8A=A4=ED=8E=98?= =?UTF-8?q?=EC=9D=B4=EC=8A=A4=20=ED=82=A4=20=EC=B2=98=EB=A6=AC=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EA=B0=9C=EC=84=A0=20=EB=B0=8F=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/error.vue | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/error.vue b/app/error.vue index 7a80080..2da691b 100644 --- a/app/error.vue +++ b/app/error.vue @@ -88,6 +88,14 @@ const handleBack = () => { // navigateTo(`${router.currentRoute.value.path}`) } +// 백스페이스 키 처리 +const handleKeydown = (e: KeyboardEvent) => { + if (e.key === 'Backspace' && + !['INPUT', 'TEXTAREA'].includes((e.target as HTMLElement).tagName)) { + e.preventDefault() + handleBack() + } +} // 500 에러 발생 시 /error 페이지로 리다이렉트 onMounted(() => { @@ -105,22 +113,14 @@ onMounted(() => { isLoading.value = false }) - // 백스페이스 키 처리 - const handleKeydown = (e: KeyboardEvent) => { - if (e.key === 'Backspace' && - !['INPUT', 'TEXTAREA'].includes((e.target as HTMLElement).tagName)) { - e.preventDefault() - handleBack() - } - } window.addEventListener('keydown', handleKeydown) window.addEventListener('popstate', handleBack) - onUnmounted(() => { - window.removeEventListener('keydown', handleKeydown) - window.removeEventListener('popstate', handleBack) - }) +}) +onUnmounted(() => { + window.removeEventListener('keydown', handleKeydown) + window.removeEventListener('popstate', handleBack) }) \ No newline at end of file