How can I reset layout inheritance in Svelte?
Parent
I have a parent layout at src/routes/+layout.svelte
:
<script> import Header from "$lib/components/Header.svelte";</script><Header/><slot/>
Home page result
Child
In a child route, src/routes/(admin)/+layout@.svelte
, I want to reset the layout inheritance. This +layout@.svelte supposed to work, but for some reason it doesn't. The header component from the parent layout still persists in dashboard page. Currently, my +layout@.svelte
looks like this:
<slot/>
Dashboad page result
However, the header from src/routes/+layout.svelte
still appears. How can I properly reset the layout inheritance so that the child layout does not include the parent header?
Folder structure
routes/├── (admin)/│└── dashboard/│ | ├──+page.svelte│└──+layout@.svelte├── styles.css├──+layout.svelte├──+page.svelte├──+page.ts└── app.html