You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: templates/template-sycamore/src/app.rs.lte
+19-16Lines changed: 19 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
use serde::{Deserialize, Serialize};
2
2
use sycamore::futures::spawn_local_scoped;
3
3
use sycamore::prelude::*;
4
-
use sycamore::rt::Event;
4
+
use sycamore::web::events::SubmitEvent;
5
5
use wasm_bindgen::prelude::*;
6
6
7
7
#[wasm_bindgen]
@@ -16,46 +16,49 @@ struct GreetArgs<'a> {
16
16
}
17
17
18
18
#[component]
19
-
pub fn App<G: Html>(cx: Scope) -> View<G> {
20
-
let name = create_signal(cx, String::new());
21
-
let greet_msg = create_signal(cx, String::new());
19
+
pub fn App() -> View {
20
+
let name = create_signal(String::new());
21
+
let greet_msg = create_signal(String::new());
22
22
23
-
let greet = move |e: Event| {
23
+
let greet = move |e: SubmitEvent| {
24
24
e.prevent_default();
25
-
spawn_local_scoped(cx, async move {
25
+
spawn_local_scoped(async move {
26
26
// Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
27
-
let args = serde_wasm_bindgen::to_value(&GreetArgs { name: &name.get() }).unwrap();
27
+
let args = serde_wasm_bindgen::to_value(&GreetArgs {
0 commit comments