Skip to content

Commit

Permalink
Enable nesting routers
Browse files Browse the repository at this point in the history
  • Loading branch information
scmmmh committed Nov 22, 2023
1 parent 4015d8c commit 888f388
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion museum_map/server/frontend/src/simple-svelte-router/Route.svelte
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<script lang="ts">
import { onDestroy, tick } from "svelte";
import { onDestroy, tick, getContext, setContext } from "svelte";
import { location } from "./store";
export let path: string;
export let handleFocus: boolean = true;
const basePath = getContext("simple-svelte-router-base") || "";
if (path.endsWith("*")) {
setContext(
"simple-svelte-router-base",
basePath + path.substring(0, path.length - 1),
);
} else {
setContext("simple-svelte-router-base", basePath + path);
}
let routeName: string = location.registerRoute(path);
let matches = false;
let startMarker: HTMLElement | null = null;
Expand Down

0 comments on commit 888f388

Please sign in to comment.