1 <script>
2 import { invoke } from "@tauri-apps/api/core"
3
4 let name = $state("");
5 let greetMsg = $state("")
6
7 async function greet(){
8 // Learn more about Tauri commands at https://v2.tauri.app/develop/calling-rust/#commands
9 greetMsg = await invoke("greet", { name })
10 }
11 </script>
12
13 <div>
14 <div class="row">
15 <input id="greet-input" placeholder="Enter a name..." bind:value={name} />
16 <button onclick={greet}>
17 Greet
18 </button>
19 </div>
20 <p>{greetMsg}</p>
21 </div>
22