docs: add note that layout root cannot be <slot /> (#4151)

This commit is contained in:
Daniel Roe 2022-04-07 11:59:40 +01:00 committed by GitHub
parent 7e0b30f66e
commit 114ec8982d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,7 +13,7 @@ Layouts are placed in the `layouts/` directory and will be automatically loaded
If you only have a single layout in your application, we recommend to use [app.vue](/guide/directory-structure/app) instead.
::alert{type=warning}
Unlike other components, your layouts must have a single root element to allow Nuxt to apply transitions between layout changes.
Unlike other components, your layouts must have a single root element to allow Nuxt to apply transitions between layout changes - and this root element cannot be a `<slot />`.
::
## Example: Enabling layouts with `app.vue`