mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
docs: sync documents (#2443)
Co-authored-by: misitebao <misitebao@users.noreply.github.com>
This commit is contained in:
co-authored by
misitebao
parent
e339c40e85
commit
4cd873fecb
@@ -71,6 +71,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
|
||||
| -windowsconsole | Manter a janela de console para builds do Windows | |
|
||||
| -obfuscate | Ofuscar a aplicação usando [garble](https://github.com/burrowers/garble) | false |
|
||||
| -garbleargs | Argumentos para passar para o garble | `-literals -tiny -seed=random` |
|
||||
| -nosyncgomod | Do not sync go.mod with the Wails version | false |
|
||||
|
||||
Para uma descrição detalhada do sinalizador `webview2`, consulte o guia [Windows](../guides/windows.mdx).
|
||||
|
||||
@@ -80,8 +81,10 @@ Exemplo:
|
||||
|
||||
`wails build -clean -o myproject.exe`
|
||||
|
||||
:::Info
|
||||
:::info
|
||||
|
||||
On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`.
|
||||
|
||||
:::
|
||||
|
||||
:::info UPX no Apple Silicon
|
||||
@@ -184,6 +187,9 @@ Your system is ready for Wails development!
|
||||
| -save | Salva o `assetdir`, `reloaddirs`,`wailsjsdir`,`debounce`,`devserver` e `frontenddevserverurl` passado, flag em `wails.json` para realizar chamadas subsequentes. | |
|
||||
| -race | Realiza build com o Go race detector | false |
|
||||
| -s | Pular build do frontend | false |
|
||||
| -nosyncgomod | Do not sync go.mod with the Wails version | false |
|
||||
|
||||
|
||||
|
||||
Exemplo:
|
||||
|
||||
|
||||
@@ -50,6 +50,7 @@ func main() {
|
||||
OnBeforeClose: app.beforeClose,
|
||||
CSSDragProperty: "--wails-draggable",
|
||||
CSSDragValue: "drag",
|
||||
EnableFraudulentWebsiteDetection: false,
|
||||
ZoomFactor: 1.0,
|
||||
IsZoomControlEnabled: false,
|
||||
Bind: []interface{}{
|
||||
@@ -77,7 +78,8 @@ func main() {
|
||||
// OnSuspend is called when Windows enters low power mode
|
||||
OnSuspend func()
|
||||
// OnResume is called when Windows resumes from low power mode
|
||||
OnResume func()
|
||||
OnResume func(),
|
||||
WebviewGpuDisabled: false,
|
||||
},
|
||||
Mac: &mac.Options{
|
||||
TitleBar: &mac.TitleBar{
|
||||
@@ -100,6 +102,7 @@ func main() {
|
||||
Linux: &linux.Options{
|
||||
Icon: icon,
|
||||
WindowIsTranslucent: false,
|
||||
WebviewGpuPolicy: linux.WebviewGpuPolicyAlways,
|
||||
},
|
||||
Debug: options.Debug{
|
||||
OpenInspectorOnStartup: false,
|
||||
@@ -232,11 +235,11 @@ Not all features of an `http.Request` are currently supported, please see the fo
|
||||
| DELETE | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Request Body | ✅ | ✅ | ❌ |
|
||||
| Request Body Streaming | ❌ | ❌ | ❌ |
|
||||
| Request Body Streaming | ✅ | ✅ | ❌ |
|
||||
| Response StatusCodes | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Headers | ✅ | ✅ | ✅ [^1] |
|
||||
| Response Body | ✅ | ✅ | ✅ |
|
||||
| Response Body Streaming | ❌ | ❌ | ✅ |
|
||||
| Response Body Streaming | ❌ | ✅ | ✅ |
|
||||
| WebSockets | ❌ | ❌ | ❌ |
|
||||
| HTTP Redirects 30x | ✅ | ❌ | ❌ |
|
||||
|
||||
@@ -356,6 +359,12 @@ Indicates what value the `CSSDragProperty` style should have to drag the window.
|
||||
|
||||
Name: CSSDragValue<br/> Type: `string`
|
||||
|
||||
### EnableFraudulentWebsiteDetection
|
||||
|
||||
EnableFraudulentWebsiteDetection enables scan services for fraudulent content, such as malware or phishing attempts. These services might send information from your app like URLs navigated to and possibly other content to cloud services of Apple and Microsoft.
|
||||
|
||||
Name: EnableFraudulentWebsiteDetection<br/> Type: `bool`
|
||||
|
||||
### ZoomFactor
|
||||
|
||||
Name: ZoomFactor<br/> Type: `float64`
|
||||
@@ -542,6 +551,12 @@ If set, this function will be called when Windows resumes from low power mode (s
|
||||
|
||||
Name: OnResume<br/> Type: `func()`
|
||||
|
||||
#### WebviewGpuIsDisabled
|
||||
|
||||
Setting this to `true` will disable GPU hardware acceleration for the webview.
|
||||
|
||||
Name: WebviewGpuIsDisabled<br/> Type: `bool`
|
||||
|
||||
### Mac
|
||||
|
||||
This defines [Mac specific options](#mac).
|
||||
@@ -722,6 +737,20 @@ Setting this to `true` will make the window background translucent. Some window
|
||||
|
||||
Name: WindowIsTranslucent<br/> Type: `bool`
|
||||
|
||||
#### WebviewGpuPolicy
|
||||
|
||||
This option is used for determining the webview's hardware acceleration policy.
|
||||
|
||||
Name: WebviewGpuPolicy<br/> Type: [`options.WebviewGpuPolicy`](#webviewgpupolicy-type)<br/> Default: `WebviewGpuPolicyAlways`
|
||||
|
||||
##### WebviewGpuPolicy type
|
||||
|
||||
| Value | Description |
|
||||
| ------------------------ | -------------------------------------------------------------------- |
|
||||
| WebviewGpuPolicyAlways | Hardware acceleration is always enabled |
|
||||
| WebviewGpuPolicyOnDemand | Hardware acceleration is enabled/disabled as request by web contents |
|
||||
| WebviewGpuPolicyNever | Hardware acceleration is always disabled |
|
||||
|
||||
### Debug
|
||||
|
||||
This defines [Debug specific options](#Debug) that apply to debug builds.
|
||||
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
---
|
||||
sidebar_position: 8
|
||||
---
|
||||
|
||||
# Clipboard
|
||||
|
||||
This part of the runtime provides access to the operating system's clipboard.<br/> The current implementation only handles text.
|
||||
|
||||
### ClipboardGetText
|
||||
|
||||
This method reads the currently stored text from the clipboard.
|
||||
|
||||
Go: `ClipboardGetText(ctx context.Context) (string, error)`<br/> Returns: a string (if the clipboard is empty an empty string will be returned) or an error.
|
||||
|
||||
JS: `ClipboardGetText(): Promise<string>`<br/> Returns: a promise with a string result (if the clipboard is empty an empty string will be returned).
|
||||
|
||||
### ClipboardSetText
|
||||
|
||||
This method writes a text to the clipboard.
|
||||
|
||||
Go: `ClipboardSetText(ctx context.Context, text string) error`<br/> Returns: an error if there is any.
|
||||
|
||||
JS: `ClipboardSetText(text: string): Promise<boolean>`<br/> Returns: a promise with true result if the text was successfully set on the clipboard, false otherwise.
|
||||
@@ -34,4 +34,4 @@ Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optio
|
||||
|
||||
Este método emite o evento fornecido. Os dados opcionais podem ser passados com o evento. Isto irá acionar quaisquer ouvintes de eventos.
|
||||
|
||||
Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`<br/> JS: `EventsEmit(ctx context, optionalData function(optionalData?: any))`
|
||||
Go: `EventsEmit(ctx context.Context, eventName string, optionalData ...interface{})`<br/> JS: `EventsEmit(eventName: string, ...optionalData: any)`
|
||||
|
||||
@@ -14,6 +14,7 @@ Ele tem métodos de utilitário para:
|
||||
- [Eventos](events.mdx)
|
||||
- [Browser](browser.mdx)
|
||||
- [Registro](log.mdx)
|
||||
- [Clipboard](clipboard.mdx)
|
||||
|
||||
O runtime do Go está disponível através da importação de `github.com/wailsapp/wails/v2/pkg/runtime`. Todos os métodos neste pacote assumem um contexto como o primeiro parâmetro. Este contexto deve ser obtido a partir dos ganchos [OnStartup](../options.mdx#onstartup) ou [OnDomReady](../options.mdx#ondomready).
|
||||
|
||||
|
||||
Reference in New Issue
Block a user