chore(examples): cleanup + routing

This commit is contained in:
moklick
2023-03-08 17:44:54 +01:00
parent 1153486ae2
commit 71cdc0ff02
12 changed files with 256 additions and 185 deletions
@@ -0,0 +1,37 @@
<script lang="ts">
import { goto } from '$app/navigation';
const routes = [
'overview',
'stress'
];
const onChange = (event: Event) => {
const route = (event.target as HTMLSelectElement).value;
goto(`/${route}`);
};
</script>
<header>
<div class="logo">SvelteFlow</div>
<select on:change={onChange}>
{#each routes as route}
<option value={route}>{route}</option>
{/each}
</select>
</header>
<style>
header {
padding: 10px;
border-bottom: 1px solid #eee;
display: flex;
font-weight: 700;
align-items: center;
color: #111;
}
.logo {
margin-right: 1rem;
}
</style>
@@ -0,0 +1 @@
export { default as Header } from './Header.svelte';