🐞 fix: input component value change

This commit is contained in:
luoxiao 2023-04-06 16:21:42 +08:00
parent 277ee00d3d
commit 5a78c1216c
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ pub fn App(cx: Scope) -> impl IntoView {
});
view! { cx,
<Space>
<Input value=count_string.get() on_input=on_input/>
<Input value=count_string on_input=on_input/>
<Button on:click=move |_| set_theme.update(move |value| *value = Theme::dark()) type_=button_type>"theme"</Button>
<Button on:click=move |_| set_button_type.update(move |value| *value = ButtonType::PRIMARY)>"click"</Button>
<Button on:click=move |_| set_count.update(move |value| *value += 1.0) type_=button_type>"click"</Button>

View file

@ -21,7 +21,7 @@ pub fn Input(
view! {
cx, class=class_name,
<div class:jo-input=true>
<input type="text" prop:value=value.get() ref=input_ref/>
<input type="text" prop:value=move || value.get() ref=input_ref/>
</div>
}
}