mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-05 05:52:33 +08:00

* Update nsis template * Move app data into config.yml * mac support * Add FileAssociations application config option Support `ApplicationOpenedWithFile` event on Windows Add docs * Add FileAssociations application config option Support `ApplicationOpenedWithFile` event on Windows Add docs Add test project * Update example & docs. Fix show window bug. * Fix window show event bug * Update changelog
22 lines
557 B
JavaScript
22 lines
557 B
JavaScript
import {GreetService} from "./bindings/changeme";
|
|
import {Events} from "@wailsio/runtime";
|
|
|
|
const resultElement = document.getElementById('result');
|
|
const timeElement = document.getElementById('time');
|
|
|
|
window.doGreet = () => {
|
|
let name = document.getElementById('name').value;
|
|
if (!name) {
|
|
name = 'anonymous';
|
|
}
|
|
GreetService.Greet(name).then((result) => {
|
|
resultElement.innerText = result;
|
|
}).catch((err) => {
|
|
console.log(err);
|
|
});
|
|
}
|
|
|
|
Events.On('time', (time) => {
|
|
timeElement.innerText = time.data;
|
|
});
|