N
Nuxtβ€’11mo ago
Ulrich

Nuxt Layout with named slot

Hello, I'm using a layout in a component with named slot and a default slot, but i faced this issue (in image) about template, how to fix it ?πŸ€” Thanks
No description
11 Replies
manniL
manniLβ€’11mo ago
can you also show the code? πŸ™‚
Ulrich
UlrichOPβ€’11mo ago
That's my two files, link.vue (a layout) and contact.vue that use that layout
No description
No description
κš²κšΆκ›‰κ›‰κšΆκ›ƒπ–£ 
does it actually not work or is just IDE complaining?
Ulrich
UlrichOPβ€’11mo ago
It doesn't work
κš²κšΆκ›‰κ›‰κšΆκ›ƒπ–£ 
what if you move the template outside the div?
Ulrich
UlrichOPβ€’11mo ago
Same problem, I have to use Nuxtlayout components explicitly
Dubem
Dubemβ€’11mo ago
Do this instead, Sorry I am using pug, but simply you need to use <nuxt-layout name="links" />. Note you need also set the definePageMeta({ layout: "another-layout",}),
No description
No description
Ulrich
UlrichOPβ€’11mo ago
yes i mentioned it before, only explicitly NuxtLayout component seems to work here
Dubem
Dubemβ€’11mo ago
Oh, Ok missed that Then I am interested in this solution as well. Cause I think I have once had this usecase
Ulrich
UlrichOPβ€’11mo ago
maybe @manniL / TheAlexLichter can exeplain it to us
Nisthar
Nistharβ€’8mo ago
what if you want the template inside a child page? like a page title for each page

Did you find this page helpful?