mirror of
https://github.com/leptos-rs/leptos
synced 2024-11-10 14:54:16 +00:00
Fix up TodoMVC example and add build script on client side
This commit is contained in:
parent
07a9be5bcf
commit
2c90922385
4 changed files with 4 additions and 3 deletions
|
@ -9,7 +9,7 @@ crate-type = ["cdylib", "rlib"]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
console_log = "0.2"
|
console_log = "0.2"
|
||||||
leptos = { path = "../../../leptos", features = ["hydrate"] }
|
leptos = { path = "../../../leptos", features = ["hydrate"] }
|
||||||
todomvc = { path = "../../todomvc", features = ["hydrate"] }
|
todomvc = { path = "../../todomvc", default-features = false, features = ["hydrate"] }
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
wasm-bindgen = "0.2"
|
wasm-bindgen = "0.2"
|
||||||
wee_alloc = "0.4"
|
wee_alloc = "0.4"
|
||||||
|
|
1
examples/todomvc-ssr/todomvc-ssr-client/build.sh
Normal file
1
examples/todomvc-ssr/todomvc-ssr-client/build.sh
Normal file
|
@ -0,0 +1 @@
|
||||||
|
wasm-pack build --target=web --release
|
|
@ -19,7 +19,7 @@ lto = true
|
||||||
opt-level = 'z'
|
opt-level = 'z'
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["hydrate"]
|
default = ["csr"]
|
||||||
csr = ["leptos/csr"]
|
csr = ["leptos/csr"]
|
||||||
hydrate = ["leptos/hydrate"]
|
hydrate = ["leptos/hydrate"]
|
||||||
ssr = ["leptos/ssr"]
|
ssr = ["leptos/ssr"]
|
||||||
|
|
|
@ -273,7 +273,7 @@ pub fn Todo(cx: Scope, todo: Todo) -> Element {
|
||||||
class="edit"
|
class="edit"
|
||||||
class:hidden={move || !(editing)()}
|
class:hidden={move || !(editing)()}
|
||||||
prop:value={move || todo.title.get()}
|
prop:value={move || todo.title.get()}
|
||||||
on:focusout=|ev| save(&event_target_value(&ev))
|
on:focusout=move |ev| save(&event_target_value(&ev))
|
||||||
on:keyup={move |ev| {
|
on:keyup={move |ev| {
|
||||||
let key_code = ev.unchecked_ref::<web_sys::KeyboardEvent>().key_code();
|
let key_code = ev.unchecked_ref::<web_sys::KeyboardEvent>().key_code();
|
||||||
if key_code == ENTER_KEY {
|
if key_code == ENTER_KEY {
|
||||||
|
|
Loading…
Reference in a new issue