mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 06:44:17 +00:00
examples: revert changes to counter
This commit is contained in:
parent
2c4f11b238
commit
c771ab7e71
1 changed files with 2 additions and 21 deletions
|
@ -10,7 +10,7 @@ pub fn SimpleCounter(
|
|||
/// The change that should be applied each time the button is clicked.
|
||||
step: i32,
|
||||
) -> impl IntoView {
|
||||
/*let (value, set_value) = signal(initial_value);
|
||||
let (value, set_value) = signal(initial_value);
|
||||
|
||||
view! {
|
||||
<div>
|
||||
|
@ -19,24 +19,5 @@ pub fn SimpleCounter(
|
|||
<span>"Value: " {value} "!"</span>
|
||||
<button on:click=move |_| set_value.update(|value| *value += step)>"+1"</button>
|
||||
</div>
|
||||
}*/
|
||||
App()
|
||||
}
|
||||
|
||||
use gloo_timers::future::TimeoutFuture;
|
||||
use leptos::{html::Input, prelude::*};
|
||||
|
||||
#[component]
|
||||
fn Widget() -> impl IntoView {
|
||||
let input_ref = NodeRef::<Input>::new();
|
||||
|
||||
Effect::new(move |_| {
|
||||
let Some(_) = input_ref.get() else {
|
||||
log!("no ref");
|
||||
return;
|
||||
};
|
||||
log!("ref");
|
||||
});
|
||||
|
||||
view! { <input node_ref=input_ref type="text"/> }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue