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-svelte-ts/src/routes/+page.svelte.lte
+5-4
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
<script lang="ts">
2
2
import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
3
3
4
-
let name = "";
5
-
let greetMsg = "";
4
+
let name = $state("");
5
+
let greetMsg = $state("");
6
6
7
-
async function greet() {
7
+
async function greet(event: Event) {
8
+
event.preventDefault();
8
9
// Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
9
10
greetMsg = await invoke("greet", { name });
10
11
}
@@ -26,7 +27,7 @@
26
27
</div>
27
28
<p>Click on the Tauri, Vite, and SvelteKit logos to learn more.</p>
Copy file name to clipboardExpand all lines: templates/template-svelte/src/routes/+page.svelte.lte
+5-4
Original file line number
Diff line number
Diff line change
@@ -1,10 +1,11 @@
1
1
<script>
2
2
import { invoke } from "@tauri-apps/api/{% if v2 %}core{% else %}tauri{% endif %}";
3
3
4
-
let name = "";
5
-
let greetMsg = "";
4
+
let name = $state("");
5
+
let greetMsg = $state("");
6
6
7
-
async function greet() {
7
+
async function greet(event) {
8
+
event.preventDefault();
8
9
// Learn more about Tauri commands at {% if v2 %}https://tauri.app/develop/calling-rust/{% else %}https://v1.tauri.app/v1/guides/features/command{% endif %}
9
10
greetMsg = await invoke("greet", { name });
10
11
}
@@ -26,7 +27,7 @@
26
27
</div>
27
28
<p>Click on the Tauri, Vite, and SvelteKit logos to learn more.</p>
0 commit comments