anki/svelte/src/ui/App.svelte
2020-01-06 16:23:55 +10:00

32 lines
669 B
Svelte

<style>
/* Style for "active" links; need to mark this :global because the router adds the class directly */
:global(a.active) {
color: red;
}
</style>
<script>
import DeckDueTree from "./DeckDueTree.svelte";
import BrowseScreen from "./BrowseScreen.svelte";
import Router from "svelte-spa-router";
import { link } from "svelte-spa-router";
import active from "svelte-spa-router/active";
const routes = {
// Exact path
"/": DeckDueTree,
"/browse": BrowseScreen
};
</script>
<body>
<nav>
<a href="/" use:link use:active>Decks</a>
<a href="/browse" use:link use:active>Browse</a>
</nav>
<Router {routes} />
</body>