mirror of
https://github.com/pheralb/svgl.git
synced 2025-02-06 06:58:04 +08:00
✨ Update dynamic route.
This commit is contained in:
parent
4b36ee02ba
commit
22adf5919e
@ -3,6 +3,7 @@
|
|||||||
import type { iSVG } from '@/types/svg';
|
import type { iSVG } from '@/types/svg';
|
||||||
export let data: PageData;
|
export let data: PageData;
|
||||||
let svgsByCategory = data.props?.svgs || [];
|
let svgsByCategory = data.props?.svgs || [];
|
||||||
|
let category = data.props?.category || '';
|
||||||
|
|
||||||
// Components:
|
// Components:
|
||||||
import Container from '@/components/container.svelte';
|
import Container from '@/components/container.svelte';
|
||||||
@ -32,7 +33,7 @@
|
|||||||
<Search
|
<Search
|
||||||
bind:searchTerm
|
bind:searchTerm
|
||||||
on:input={searchSvgs}
|
on:input={searchSvgs}
|
||||||
placeholder={`Search ${filteredSvgs.length} logos...`}
|
placeholder={`Search ${filteredSvgs.length} ${category} logos...`}
|
||||||
/>
|
/>
|
||||||
<Grid>
|
<Grid>
|
||||||
{#each filteredSvgs as svg}
|
{#each filteredSvgs as svg}
|
||||||
|
@ -17,6 +17,7 @@ export const load = (async ({ params }) => {
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
props: {
|
props: {
|
||||||
|
category: slug,
|
||||||
svgs: svgsByCategory
|
svgs: svgsByCategory
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user