-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(nuxt): add setPageLayout
utility (#6826)
#7075
Conversation
β Deploy Preview for nuxt3-docs ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Following up nuxt/nuxt#14710, i understand there is a way to use prop binding for global usage of |
I did consider updating the default value but feel that it's not optimal. Consider this use case:
If we want to update the default layout (and I'm not sure we should) then a |
I would like to know if there is a possibility of having more than one <template>
<div>
<NuxtLayout>
<template #header> Some header template content. default</template>
</NuxtLayout>
<NuxtLayout name="custom">
<template #header> Some header template content. custom</template>
</NuxtLayout>
<NuxtLayout name="custom-two">
<template #header> Some header template content. custom-two</template>
</NuxtLayout>
</div>
</template> Link: https://stackblitz.com/edit/github-m7s6nu?file=pages%2Findex.vue |
setLayout
utility (#6826)setPageLayout
utility (#6826)
setPageLayout
utility (#6826)setPageLayout
utility (#6826)
Makes sense to introduce setDefaultLayout utility for universal usage ππΌ |
π Linked issue
resolves nuxt/nuxt#14710
β Type of change
π Description
This adds a
setPageLayout
utility to handle complexities associated with changing layout keyed off ofroute.meta
. Namely, it's complicated to persist the change from server -> client. This persists the server-set layout via a customuseState
which is only used on the initial hydration. Subsequent layout changes are reactive and don't need to be hydrated.π Checklist