usar inject en vez de hackily replace
This commit is contained in:
parent
3a2aad4d23
commit
dc99cbfb9e
1 changed files with 5 additions and 4 deletions
|
@ -1,4 +1,5 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import { inject } from "regexparam";
|
||||||
import { loadWorlds } from "../lib/worldStorage";
|
import { loadWorlds } from "../lib/worldStorage";
|
||||||
import { routes } from "../lib/routes";
|
import { routes } from "../lib/routes";
|
||||||
|
|
||||||
|
@ -13,10 +14,10 @@
|
||||||
{#each worlds as world}
|
{#each worlds as world}
|
||||||
<li>
|
<li>
|
||||||
<a
|
<a
|
||||||
href={routes.Page.replace(":worldId", world.room).replace(
|
href={inject(routes.Page, {
|
||||||
":pageId",
|
worldId: world.room,
|
||||||
"index"
|
pageId: "index",
|
||||||
)}>{world.room}</a
|
})}>{world.room}</a
|
||||||
>
|
>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
|
|
Loading…
Reference in a new issue