N
Nuxt6mo 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
manniL6mo ago
can you also show the code? 🙂
Ulrich
UlrichOP6mo 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
UlrichOP6mo ago
It doesn't work
ʏᴜᴢᴢᴜᴡᴏ
what if you move the template outside the div?
Ulrich
UlrichOP6mo ago
Same problem, I have to use Nuxtlayout components explicitly
Dubem
Dubem6mo 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
UlrichOP6mo ago
yes i mentioned it before, only explicitly NuxtLayout component seems to work here
Dubem
Dubem6mo ago
Oh, Ok missed that Then I am interested in this solution as well. Cause I think I have once had this usecase
Ulrich
UlrichOP6mo ago
maybe @manniL / TheAlexLichter can exeplain it to us
Nisthar
Nisthar3mo ago
what if you want the template inside a child page? like a page title for each page
Want results from more Discord servers?
Add your server