<NuxtErrorBoundary> 컴포넌트는 onErrorCaptured 를 내부적으로 사용한다.
Events
- @error : 컴포넌트의 기본 슬롯에서 오류가 발생할 때 생기는 이벤트
<template>
<NuxtErrorBoundary @error="logSomeError">
<!-- ... -->
</NuxtErrorBoundary>
</template>
Slots
- #error : 오류 발생 시 표시할 대체 컨텐츠를 지정한다.
<template>
<NuxtErrorBoundary>
<!-- ... -->
<template #error="{ error }">
<p>An error occurred: {{ error }}</p>
</template>
</NuxtErrorBoundary>
</template>
참고) Docs > Getting Started > Error Handling
'Nuxt 공식문서 번역 > Components' 카테고리의 다른 글
| <NuxtIsland> (0) | 2023.12.12 |
|---|---|
| <NuxtWelcome> (0) | 2023.12.12 |
| <NuxtLoadingIndicator> (0) | 2023.12.12 |
| <NuxtLink> (1) | 2023.12.11 |
| <NuxtLayout> (0) | 2023.12.11 |
