Documentación offline Nuxt main

useLayout

main Documentación oficial Licencia MITDescargado el 2026-08-02

En esta página

Description#

useLayout returns a computed ref with the layout resolved for the current route, using the same chain as <NuxtLayout>: the page's layout meta first, then the appLayout set via route rules, then 'default'.

Within a rendered <NuxtLayout> it reflects the enclosing layout; outside of one (for example in app.vue) it returns the layout that would be resolved for the current route.

Unlike reading route.meta.layout directly, this accounts for a layout set through route rules and stays in sync as the route changes.

Return Values#

A read-only computed ref resolving to the layout name (a string), or false when the layout is disabled.

Example#

```vue [app.vue]

```