Argh
This commit is contained in:
parent
51c76921a0
commit
bb7d09d1ef
6 changed files with 297 additions and 98 deletions
|
@ -66,5 +66,17 @@
|
|||
</form>
|
||||
</main>
|
||||
<p id="cnt-msg"></p>
|
||||
<main class="container">
|
||||
<form class="column" id="push-form">
|
||||
<button type="submit">
|
||||
↑
|
||||
</button>
|
||||
</form>
|
||||
<form class="column" id="push-form">
|
||||
<button type="submit">
|
||||
↓
|
||||
</button>
|
||||
</form>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
|
17
src/main.js
17
src/main.js
|
@ -2,14 +2,9 @@ const { invoke } = window.__TAURI__.core;
|
|||
|
||||
let cntMsgEl;
|
||||
|
||||
// async function greet() {
|
||||
// Learn more about Tauri commands at https://tauri.app/develop/calling-rust/
|
||||
// greetMsgEl.textContent = await invoke("greet", { name: greetInputEl.value });
|
||||
//}
|
||||
|
||||
async function swap(s) {
|
||||
invoke("swap", { store: s });
|
||||
cntMsgEl.textContent = await invoke("pull_data", {});
|
||||
await invoke("swap", { store: s });
|
||||
cntMsgEl.textContent = await invoke("count", {});
|
||||
}
|
||||
|
||||
window.addEventListener("DOMContentLoaded", () => {
|
||||
|
@ -38,4 +33,12 @@ window.addEventListener("DOMContentLoaded", () => {
|
|||
e.preventDefault();
|
||||
swap("tegut");
|
||||
});
|
||||
document.querySelector("#push-form").addEventListener("submit", (e) => {
|
||||
e.preventDefault();
|
||||
await invoke("push_data");
|
||||
});
|
||||
document.querySelector("#pull-form").addEventListener("submit", (e) => {
|
||||
e.preventDefault();
|
||||
cntMsgEl.textContent = await await invoke("pull_data", {});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue