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
+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
|
||||
|
||||
This method emits the given event. Optional data may be passed with the event. This will trigger any event listeners.
|
||||
|
||||
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 @@ sidebar_position: 1
|
||||
- [Events](events.mdx)
|
||||
- [Browser](browser.mdx)
|
||||
- [Log](log.mdx)
|
||||
- [Clipboard](clipboard.mdx)
|
||||
|
||||
Go 런타임은 `github.com/wailsapp/wails/v2/pkg/runtime` 가져오기를 통해 사용할 수 있습니다. 이 패키지의 모든 메소드는 컨텍스트를 첫 번째 매개변수로 사용합니다. 이 컨텍스트는 [OnStartup](../options.mdx#onstartup) 또는 [OnDomReady](../options.mdx#ondomready) 후크에서 가져와야 합니다.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user