Get routes by category and display them
This commit is contained in:
parent
12e1351cca
commit
40dd8d0fb2
1 changed files with 12 additions and 3 deletions
|
@ -1,13 +1,22 @@
|
|||
<script lang="ts">
|
||||
import Route from '$lib/components/Route.svelte';
|
||||
import HomeHeader from '$lib/components/HomeHeader.svelte';
|
||||
export let data;
|
||||
import { onMount } from 'svelte';
|
||||
import { getRouteByCategory } from '$lib/repo';
|
||||
|
||||
let id = 0;
|
||||
let routes = [];
|
||||
onMount(async () => {
|
||||
id = Number(window.location.href.split('paths/')[1]);
|
||||
routes = await getRouteByCategory(id);
|
||||
})
|
||||
</script>
|
||||
|
||||
<HomeHeader title={data.title}></HomeHeader>
|
||||
<!--
|
||||
<HomeHeader title={title}></HomeHeader>-->
|
||||
|
||||
<div>
|
||||
{#each data.routes as route}
|
||||
{#each routes as route}
|
||||
<Route {route}></Route>
|
||||
{/each}
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue