5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 19:50:15 +08:00

Add navigation from index.html troubleshooting guide

This commit is contained in:
Lea Anthony 2022-07-14 21:13:02 +10:00
parent 69016c6c6f
commit 3ecd72d6c9
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -95,3 +95,17 @@ Source: https://github.com/wailsapp/wails/issues/1233
Sometimes the generated Typescript doesn''t have the correct types. To mitigate this,
it is possible to specify what types should be generated using the `ts_type` struct tag. For
more details, please read [this](https://github.com/tkrajina/typescriptify-golang-structs#custom-types).
## When I navigate away from `index.html`, I am unable to call methods on the frontend
If you navigate away from `index.html` to a new html file, the context will be lost. This can be fixed by adding
the following imports to the `<head>` section of any new page you navigate to:
```html
<head>
<script src="/wails/ipc.js"></script>
<script src="/wails/runtime.js"></script>
</head>
```
Source: https://github.com/wailsapp/wails/discussions/1512