Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving <NuxtLayout> to a built-in component #12829

Closed
pi0 opened this issue Nov 22, 2021 · 1 comment · Fixed by nuxt/framework#3011 or nuxt/framework#3610
Closed

Moving <NuxtLayout> to a built-in component #12829

pi0 opened this issue Nov 22, 2021 · 1 comment · Fixed by nuxt/framework#3011 or nuxt/framework#3610

Comments

@pi0
Copy link
Member

pi0 commented Nov 22, 2021

(internally discussed within team meeting)

Allow using NuxtLayout directly in app.vue:

<!-- app.vue -->
<NuxtLayout>
  <NuxtPage/>
</NuxtLayout>

For transition support, NuxtPage needs to communicate with layout. For this we can make use of a global layout state:

const layout = useLayout()
setLayout('welcome') // Only supported before rendering
// Same as useLayout().value = 'welcome'

The limitation is that layout can be only modified before or after rendering lifecycle (in plugins or client-side after mount)

@pi0
Copy link
Member Author

pi0 commented Jan 31, 2022

nuxt/framework#3011 partially resolved this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants