/
githubmirror
/
tauri
Обзор
Документация
Войти
/
githubmirror
/
tauri
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
crates/tauri-cli/templates/plugin/__example-api/tauri-app/src/App.svelte
54 строки
1 KB
Takeaki Kobayashi
fix(cli): properly migrate svelte to v5 in the plugin example template (#13912)
29 июл 2025, 12:47
Не верифицирован
29 июл 2025, 12:47
9c938be
Код
Авторство
О чём код?
<script> import Greet from './lib/Greet.svelte' import { ping } from 'tauri-plugin-{{ plugin_name }}-api' let response = $state('') function updateResponse(returnValue) { response += `[${new Date().toLocaleTimeString()}] ` + (typeof returnValue === 'string' ? returnValue : JSON.stringify(returnValue)) + '<br>' } function _ping() { ping("Pong!").then(updateResponse).catch(updateResponse) } </script> <main class="container"> <h1>Welcome to Tauri!</h1> <div class="row"> <a href="https://vite.dev" target="_blank"> <img src="/vite.svg" class="logo vite" alt="Vite Logo" /> </a> <a href="https://tauri.app" target="_blank"> <img src="/tauri.svg" class="logo tauri" alt="Tauri Logo" /> </a> <a href="https://svelte.dev" target="_blank"> <img src="/svelte.svg" class="logo svelte" alt="Svelte Logo" /> </a> </div> <p> Click on the Tauri, Vite, and Svelte logos to learn more. </p> <div class="row"> <Greet /> </div> <div> <button onclick="{_ping}">Ping</button> <div>{@html response}</div> </div> </main> <style> .logo.vite:hover { filter: drop-shadow(0 0 2em #747bff); } .logo.svelte:hover { filter: drop-shadow(0 0 2em #ff3e00); } </style>