mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-02 23:39:21 +08:00
* Fix #2280; code highlight & minor linter change * Fix #2280; adjust code highlight
This commit is contained in:
parent
e1bd841be3
commit
709244c3a2
@ -11,7 +11,7 @@ By installing a custom AssetsHandler, you can serve your own assets using a cust
|
|||||||
|
|
||||||
In our example project, we will create a simple assets handler which will load files off disk:
|
In our example project, we will create a simple assets handler which will load files off disk:
|
||||||
|
|
||||||
```go title=main.go {16-35,49}
|
```go title=main.go {17-36,49}
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
@ -141,7 +141,7 @@ Wails requires that you pass in an _instance_ of the struct for it to bind it co
|
|||||||
|
|
||||||
In this example, we create a new `App` instance and then add this instance to the `Bind` option in `wails.Run`:
|
In this example, we create a new `App` instance and then add this instance to the `Bind` option in `wails.Run`:
|
||||||
|
|
||||||
```go {16,24} title="main.go"
|
```go {17,27} title="main.go"
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
@ -188,7 +188,7 @@ func (a *App) Greet(name string) string {
|
|||||||
|
|
||||||
You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`:
|
You may bind as many structs as you like. Just make sure you create an instance of it and pass it in `Bind`:
|
||||||
|
|
||||||
```go {8-10}
|
```go {10-12}
|
||||||
//...
|
//...
|
||||||
err := wails.Run(&options.App{
|
err := wails.Run(&options.App{
|
||||||
Title: "Basic Demo",
|
Title: "Basic Demo",
|
||||||
@ -276,7 +276,7 @@ it will be returned to your frontend as a JavaScript class.
|
|||||||
|
|
||||||
:::info Note
|
:::info Note
|
||||||
|
|
||||||
Struct fields *must* have a valid `json` tag to be included in the generated TypeScript.
|
Struct fields _must_ have a valid `json` tag to be included in the generated TypeScript.
|
||||||
|
|
||||||
Anonymous nested structs are not supported at this time.
|
Anonymous nested structs are not supported at this time.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user