new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Nuxt · API · all subjects

components/errorboundary

6 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

NuxtErrorBoundary component

The <NuxtErrorBoundary> component handles client-side errors occurring in its default slot. It uses Vue's onErrorCaptured hook under the hood.

NuxtErrorBoundary @error event

The @error event is emitted when the default slot of the NuxtErrorBoundary component throws an error.

NuxtErrorBoundary #error slot

The #error slot specifies fallback content to display in case of error. The slot scope provides error (the error object) and clearError (a function to clear the error).

NuxtErrorBoundary error and clearError properties

The error property and clearError() method can be accessed on a NuxtErrorBoundary component instance via a template ref. Access them using errorBoundary.value?.error and errorBoundary.value?.clearError().

NuxtErrorBoundary example with template ref

Example: <NuxtErrorBoundary ref="errorBoundary"></NuxtErrorBoundary> in template, then use useTemplateRef('errorBoundary') in script setup to access the component instance and its error and clearError() properties.

NuxtErrorBoundary slot example with error handling

Example: <NuxtErrorBoundary> with <template #error="{ error, clearError }"> slot to display an error message and a button that calls clearError() to clear the error state.

Give your agent this brain