diff --git a/src/lib/timeline/Timeline.svelte b/src/lib/timeline/Timeline.svelte index 1e4053f757..976f846ef8 100644 --- a/src/lib/timeline/Timeline.svelte +++ b/src/lib/timeline/Timeline.svelte @@ -8,10 +8,8 @@ let { children, order = "default", class: className, ...restProps }: TimelineProps = $props(); const theme = $derived(getTheme("timeline")); - - $effect(() => { - setContext("order", order); - }); + // svelte-ignore state_referenced_locally + setContext("order", order); const olCls = $derived(timeline({ order, class: clsx(theme, className) })); @@ -23,10 +21,10 @@ @component [Go to docs](https://flowbite-svelte.com/) ## Type -[TimelineProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1953) +[TimelineProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1811) ## Props @prop children @prop order = "default" @prop class: className @prop ...restProps ---> +--> \ No newline at end of file diff --git a/src/lib/timeline/TimelineItem.svelte b/src/lib/timeline/TimelineItem.svelte index 5c9f399098..64487a8d8e 100644 --- a/src/lib/timeline/TimelineItem.svelte +++ b/src/lib/timeline/TimelineItem.svelte @@ -1,3 +1,4 @@ + + + diff --git a/src/routes/docs-examples/components/timeline/[slug]/+page.ts b/src/routes/docs-examples/components/timeline/[slug]/+page.ts new file mode 100644 index 0000000000..c72af5dfe5 --- /dev/null +++ b/src/routes/docs-examples/components/timeline/[slug]/+page.ts @@ -0,0 +1,15 @@ +import type { PageLoad } from "./$types"; +import { error } from "@sveltejs/kit"; + +export const load: PageLoad = async ({ params }) => { + try { + const post = await import(`../${params.slug}.svelte`); + const content = post.default; + + return { + content, + }; + } catch (err) { + throw error(404, `Timeline example "${params.slug}" not found`); + } +};