mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-26 07:32:01 +00:00
docs: add warning against layout as root element (#5345)
This commit is contained in:
parent
247deacc2b
commit
4e2dc037aa
@ -102,11 +102,13 @@ Even if you are using the `~/pages` integration, you can take full control by us
|
|||||||
|
|
||||||
```vue [pages/index.vue]
|
```vue [pages/index.vue]
|
||||||
<template>
|
<template>
|
||||||
<NuxtLayout name="custom">
|
<div>
|
||||||
<template #header> Some header template content. </template>
|
<NuxtLayout name="custom">
|
||||||
|
<template #header> Some header template content. </template>
|
||||||
|
|
||||||
The rest of the page
|
The rest of the page
|
||||||
</NuxtLayout>
|
</NuxtLayout>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@ -118,6 +120,10 @@ definePageMeta({
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
|
::alert{type=warning}
|
||||||
|
If you use `<NuxtLayout>` within your pages, make sure it is not the root element (or disable layout/page transitions).
|
||||||
|
::
|
||||||
|
|
||||||
## Example: changing the layout
|
## Example: changing the layout
|
||||||
|
|
||||||
You can also use a ref or computed property for your layout.
|
You can also use a ref or computed property for your layout.
|
||||||
|
Loading…
Reference in New Issue
Block a user