Merge branch 'feature/20251001-gil' into feature/202501107-all

This commit is contained in:
“hyeonggkim”
2025-11-12 13:40:37 +09:00

View File

@@ -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)
})
</script>