/
githubmirror
/
tauri
Обзор
Документация
Войти
/
githubmirror
/
tauri
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
examples/isolation/dist/index.html
34 строки
667 B
Amr Bashir
chore: cleanup and simplify examples (#10743)
27 авг 2024, 01:25
Не верифицирован
27 авг 2024, 01:25
ad83d41
Код
Авторство
О чём код?
<!DOCTYPE html> <html lang="en-US"> <head> <meta charset="UTF-8"> <title>Hello Tauri!</title> </head> <body> <div> <h1>Hello, Tauri!</h1> <div> <button id="ping">ping</button> <span id="pong"></span> </div> </div> <script> const { invoke } = window.__TAURI__.core const ping = document.querySelector("#ping") const pong = document.querySelector('#pong') ping.addEventListener("click", () => { invoke("ping") .then(() => { pong.innerText = `ok: ${Date.now()}` }) .catch(() => { pong.innerText = `error: ${Date.now()}` }) }) </script> </body> </html>