Hello I'm using the _layout to divide my app into sections like this
_layout.html
<div class="container"> <-- creates a 12 column grid
{#if $user}
<Header /> <-- spans the first row of the 12 columns
<Menu segment={child.segment}/> <-- spans the first 2 columns of the remaining rows
<Content slot={child.component}/> <-- spans the other 10 columns
{:else}
<Login />
{/if}
</div>
And this is what I'm trying to achieve
Currently I use the svelte lifecycle hooks in the content component to set the "component to display" into the slot manually but this feels wrong since the route dosnt include the component to display
<content>
<slot>
{#if dashboard}
<Dashboard />
{:elseif users}
<Users />
{/if}
</slot>
</content>
<script>
var dashboard, users = false;
export default {
oncreate() {
this.dashboard = true;
},
...
Feels like i should include the components through the routes '/' & '/users' and the content component should just display the child.component