<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <h1 id="header">Welcome from Tauri!</h1> <script> // access the pre-bundled global API functions const { invoke } = window.__TAURI__.tauri
// now we can call our Command! // You will see "Welcome from Tauri" replaced // by "Hello, World!"! invoke('greet', { name: 'World' }) // `invoke` returns a Promise .then((response) => { window.header.innerHTML = response }) </script> </body> </html>
更多建議: