Can't use custom layout on index.vue for root page
I'm encountering an issue when applying a layout to my index.vue for my root
/
path. Seemingly, nuxt is ignoring the definePageMeta({layout: 'authenticated'}) and is still using the default.vue layout. Trying definePageMeta() on a different page from root works. What could be the issue here?10 Replies
Heres what devtools is showing me, so vue/nuxt is still using the default layout
but in the index.vue root page i am using definePageMeta({layout: 'authenticated'})
heres the dom view of the default layout still being applied.
heres what the dom should be loading
It works when I use the same definePageMeta on a different page though, for example /login the layout is correctly applied
the same implmentation in the page itself
and the dom correctly displays the authenticated layout is loading
It's probably something I'm doing, but if it was wouldn't no pages be able to load the authenticated/custom layout?
Which is why I think it might be a bug.
Heres my minimal reproduction on stackblitz: https://stackblitz.com/edit/github-vmev3n
Brys
StackBlitz
Nuxt - Starter - StackBlitz
Create a new Nuxt project, module, layer or start from a theme with our collection of starters.
wait a minute, what now it works on stackblitz
i wonder if its cache
it is a cache issue
clearing .nuxt and running nuxt dev again and it works
least on stackblitz, still have an issue on my project
yeah cant get it working still on mine, using setPageLayout like you are suppsoed to for dynamic layouts does work