From 50dd87f29046895dce87b06877645e059c0eb2aa Mon Sep 17 00:00:00 2001 From: Greg Shuflin Date: Fri, 28 Nov 2025 12:43:32 -0800 Subject: [PATCH] more tutorial abstractions --- index.html | 8 +++++++- src/main.rs | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/index.html b/index.html index f097b2e..8598fe4 100644 --- a/index.html +++ b/index.html @@ -1,6 +1,12 @@ - + + + diff --git a/src/main.rs b/src/main.rs index c0cfc82..2153819 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,37 @@ use leptos::prelude::*; +#[component] +fn ProgressBar( + #[prop(default = 100)] + max: u16, + progress: ReadSignal) -> impl IntoView { + view! { + + } +} + +#[component] +fn App() -> impl IntoView { + let (count, set_count) = signal(0); + + let double_count = move || count.get() * 2; + view! { + +

+ {double_count} +

+ + } +} + + fn main() { console_error_panic_hook::set_once(); - leptos::mount::mount_to_body(|| view! {

"Hello, world!"

}) + leptos::mount::mount_to_body(App) }