mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-07 21:59:42 +08:00
48 lines
960 B
HTML
48 lines
960 B
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>Title</title>
|
|
</head>
|
|
<body>
|
|
HELLO!
|
|
<script>
|
|
function GreetService(method) {
|
|
return {
|
|
packageName: "main",
|
|
serviceName: "GreetService",
|
|
methodName: method,
|
|
args: Array.prototype.slice.call(arguments, 1),
|
|
};
|
|
}
|
|
|
|
/**
|
|
* GreetService.Greet
|
|
*
|
|
* @param name {string}
|
|
* @returns {Promise<string>}
|
|
**/
|
|
function Greet(name) {
|
|
return wails.Call(GreetService("Greet", name));
|
|
}
|
|
|
|
/**
|
|
* GreetService.GreetPerson
|
|
*
|
|
* @param person {main.Person}
|
|
* @returns {Promise<string>}
|
|
**/
|
|
function GreetPerson(person) {
|
|
return wails.Call(GreetService("GreetPerson", person));
|
|
}
|
|
|
|
window.go = window.go || {};
|
|
window.go.main = {
|
|
GreetService: {
|
|
Greet,
|
|
GreetPerson,
|
|
},
|
|
};
|
|
</script>
|
|
</body>
|
|
</html> |