docs: add explanation about layout usage in error.vue (#25396)

This commit is contained in:
Michael Brevard 2024-01-23 18:12:59 +02:00 committed by GitHub
parent 979ee466c1
commit c51272099f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ const props = defineProps({
``` ```
::callout ::callout
Although it is called an 'error page' it's not a route and shouldn't be placed in your `~/pages` directory. For the same reason, you shouldn't use `definePageMeta` within this page. Although it is called an 'error page' it's not a route and shouldn't be placed in your `~/pages` directory. For the same reason, you shouldn't use `definePageMeta` within this page. That being said, you can still use layouts in the error file, by utilizing the [`NuxtLayout`](/docs/api/components/nuxt-layout) component and specifying the name of the layout.
:: ::
The error page has a single prop - `error` which contains an error for you to handle. The error page has a single prop - `error` which contains an error for you to handle.