Skip to content

Commit

Permalink
docs: recommend <NuxtLayout> when migrating error.vue (nuxt#20690)
Browse files Browse the repository at this point in the history
  • Loading branch information
scscgit authored May 5, 2023
1 parent ad97cb4 commit fa8b29a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion docs/7.migration/6.pages-and-layouts.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`

Expand Down

0 comments on commit fa8b29a

Please sign in to comment.