mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
changed the value to bind to another input
while I fix text
This commit is contained in:
parent
c239716170
commit
c9b57ffa85
1 changed files with 17 additions and 14 deletions
|
@ -13,23 +13,26 @@ pub fn App(cx: Scope) -> View {
|
|||
|
||||
#[component]
|
||||
pub fn ComponentA(cx: Scope) -> View {
|
||||
let (value, set_value) = create_signal(cx, "".to_string());
|
||||
let (value, set_value) = create_signal(cx, "Hello?".to_string());
|
||||
div(cx)
|
||||
.child(input(cx).attr("type", "text").prop("value", (cx, value)))
|
||||
.child(p(cx).child("Value is: ").child((cx, value)).child("!"))
|
||||
.child(
|
||||
input(cx)
|
||||
.attr("type", "text")
|
||||
.prop("value", (cx, value))
|
||||
.on(ev::input, move |e| set_value(event_target_value(&e))),
|
||||
)
|
||||
.child(input(cx).attr("type", "text").prop("value", value))
|
||||
.into_view(cx)
|
||||
}
|
||||
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(feature = "hydrate")] {
|
||||
use wasm_bindgen::prelude::wasm_bindgen;
|
||||
#[cfg(feature = "hydrate")]
|
||||
use wasm_bindgen::prelude::wasm_bindgen;
|
||||
|
||||
#[wasm_bindgen(start)]
|
||||
pub fn start() {
|
||||
#[cfg(feature = "hydrate")]
|
||||
#[wasm_bindgen(start)]
|
||||
pub fn start() {
|
||||
console_error_panic_hook::set_once();
|
||||
leptos::mount_to_body(move |cx| {
|
||||
view! { cx, <App/> }
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue