5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 16:02:28 +08:00
wails/v2/internal/frontend/assetserver/testdata/main.js
2021-08-01 22:14:56 +10:00

20 lines
528 B
JavaScript

import {ready} from '@wails/runtime';
ready(() => {
// Get input + focus
let nameElement = document.getElementById("name");
nameElement.focus();
// Setup the greet function
window.greet = function () {
// Get name
let name = nameElement.value;
// Call App.Greet(name)
window.backend.main.App.Greet(name).then((result) => {
// Update result with data back from App.Greet()
document.getElementById("result").innerText = result;
});
};
});