5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-05 05:52:33 +08:00
wails/v3/examples/file-association/frontend/main.js
Lea Anthony d18b7bc4b8
V3 alpha feature/file association port (#3873)
* 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
2024-11-09 08:58:20 +11:00

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;
});