mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
[v3] Support //wails:methodID <uint32> directive in bound method comments.
This commit is contained in:
@@ -8,10 +8,16 @@ type Person struct {
|
||||
type GreetService struct {
|
||||
}
|
||||
|
||||
// Greet greets a person
|
||||
//
|
||||
//wails:methodID 1
|
||||
func (*GreetService) Greet(name string) string {
|
||||
return "Hello " + name
|
||||
}
|
||||
|
||||
// GreetPerson greets a person
|
||||
//
|
||||
//wails:methodID 2
|
||||
func (*GreetService) GreetPerson(person Person) string {
|
||||
return "Hello " + person.name
|
||||
}
|
||||
|
||||
@@ -10,19 +10,19 @@ window.go.main = {
|
||||
|
||||
/**
|
||||
* GreetService.Greet
|
||||
*
|
||||
* Greet greets a person
|
||||
* @param name {string}
|
||||
* @returns {Promise<string>}
|
||||
**/
|
||||
Greet: function(name) { wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0)); },
|
||||
Greet: function(name) { wails.CallByID(1, ...Array.prototype.slice.call(arguments, 0)); },
|
||||
|
||||
/**
|
||||
* GreetService.GreetPerson
|
||||
*
|
||||
* GreetPerson greets a person
|
||||
* @param person {main.Person}
|
||||
* @returns {Promise<string>}
|
||||
**/
|
||||
GreetPerson: function(person) { wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0)); },
|
||||
GreetPerson: function(person) { wails.CallByID(2, ...Array.prototype.slice.call(arguments, 0)); },
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -16,10 +16,6 @@ func main() {
|
||||
Bind: []any{
|
||||
&GreetService{},
|
||||
},
|
||||
BindAliases: map[uint32]uint32{
|
||||
1: 1411160069,
|
||||
2: 4021313248,
|
||||
},
|
||||
Assets: application.AssetOptions{
|
||||
FS: assets,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user