mirror of
https://github.com/kevin-DL/sapper.git
synced 2026-01-24 07:55:29 +00:00
Slot-based routing (#573)
This commit is contained in:
21
test/apps/layout/src/routes/[x]/[y]/_layout.svelte
Normal file
21
test/apps/layout/src/routes/[x]/[y]/_layout.svelte
Normal file
@@ -0,0 +1,21 @@
|
||||
<script context="module">
|
||||
import counts from '../_counts.js';
|
||||
|
||||
export function preload() {
|
||||
return {
|
||||
count: counts.y += 1
|
||||
};
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
import { page } from '@sapper/app';
|
||||
|
||||
export let count;
|
||||
export let segment;
|
||||
</script>
|
||||
|
||||
<span>y: {$page.params.y} {count}</span>
|
||||
<slot></slot>
|
||||
|
||||
<span>child segment: {segment}</span>
|
||||
Reference in New Issue
Block a user