mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 00:23:53 +00:00
docs: recommend <NuxtLayout>
when migrating error.vue
(#20690)
This commit is contained in:
parent
ad97cb45ae
commit
fa8b29a359
@ -24,7 +24,17 @@ You will also need to change how you define the layout used by a page using the
|
||||
|
||||
1. Replace `<Nuxt />` with `<slot />`
|
||||
1. Use `definePageMeta` to select the layout used by your page.
|
||||
1. Move `~/layouts/_error.vue` to `~/error.vue`. See [the error handling docs](/docs/getting-started/error-handling).
|
||||
1. Move `~/layouts/_error.vue` to `~/error.vue`. See [the error handling docs](/docs/getting-started/error-handling). If you want to ensure that this page uses a layout, you can use [the `<NuxtLayout>` component](/docs/guide/directory-structure/layouts) directly within `error.vue`:
|
||||
|
||||
```vue
|
||||
<template>
|
||||
<div>
|
||||
<NuxtLayout name="default">
|
||||
<!-- -->
|
||||
</NuxtLayout>
|
||||
</div>
|
||||
</template>
|
||||
```
|
||||
|
||||
### Example: `~/layouts/custom.vue`
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user