mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
docs: sync documents (#2013)
This commit is contained in:
+28
-28
@@ -301,115 +301,115 @@
|
||||
"description": "The title attribute for toggle word wrapping button of code block lines"
|
||||
},
|
||||
"theme.admonition.note": {
|
||||
"message": "note",
|
||||
"message": "備考",
|
||||
"description": "The default label used for the Note admonition (:::note)"
|
||||
},
|
||||
"theme.admonition.tip": {
|
||||
"message": "tip",
|
||||
"message": "ヒント",
|
||||
"description": "The default label used for the Tip admonition (:::tip)"
|
||||
},
|
||||
"theme.admonition.danger": {
|
||||
"message": "danger",
|
||||
"message": "危険",
|
||||
"description": "The default label used for the Danger admonition (:::danger)"
|
||||
},
|
||||
"theme.admonition.info": {
|
||||
"message": "info",
|
||||
"message": "情報",
|
||||
"description": "The default label used for the Info admonition (:::info)"
|
||||
},
|
||||
"theme.admonition.caution": {
|
||||
"message": "caution",
|
||||
"message": "警告",
|
||||
"description": "The default label used for the Caution admonition (:::caution)"
|
||||
},
|
||||
"theme.SearchModal.searchBox.resetButtonTitle": {
|
||||
"message": "Clear the query",
|
||||
"message": "クエリを消去",
|
||||
"description": "The label and ARIA label for search box reset button"
|
||||
},
|
||||
"theme.SearchModal.searchBox.cancelButtonText": {
|
||||
"message": "Cancel",
|
||||
"message": "キャンセル",
|
||||
"description": "The label and ARIA label for search box cancel button"
|
||||
},
|
||||
"theme.SearchModal.startScreen.recentSearchesTitle": {
|
||||
"message": "Recent",
|
||||
"message": "最近の検索",
|
||||
"description": "The title for recent searches"
|
||||
},
|
||||
"theme.SearchModal.startScreen.noRecentSearchesText": {
|
||||
"message": "No recent searches",
|
||||
"message": "最近検索したものはありません",
|
||||
"description": "The text when no recent searches"
|
||||
},
|
||||
"theme.SearchModal.startScreen.saveRecentSearchButtonTitle": {
|
||||
"message": "Save this search",
|
||||
"message": "この検索を保存",
|
||||
"description": "The label for save recent search button"
|
||||
},
|
||||
"theme.SearchModal.startScreen.removeRecentSearchButtonTitle": {
|
||||
"message": "Remove this search from history",
|
||||
"message": "この検索を履歴から消去",
|
||||
"description": "The label for remove recent search button"
|
||||
},
|
||||
"theme.SearchModal.startScreen.favoriteSearchesTitle": {
|
||||
"message": "Favorite",
|
||||
"message": "お気に入り",
|
||||
"description": "The title for favorite searches"
|
||||
},
|
||||
"theme.SearchModal.startScreen.removeFavoriteSearchButtonTitle": {
|
||||
"message": "Remove this search from favorites",
|
||||
"message": "お気に入りからこの検索を消去",
|
||||
"description": "The label for remove favorite search button"
|
||||
},
|
||||
"theme.SearchModal.errorScreen.titleText": {
|
||||
"message": "Unable to fetch results",
|
||||
"message": "結果を取得できません",
|
||||
"description": "The title for error screen of search modal"
|
||||
},
|
||||
"theme.SearchModal.errorScreen.helpText": {
|
||||
"message": "You might want to check your network connection.",
|
||||
"message": "ネットワーク接続を確認してください。",
|
||||
"description": "The help text for error screen of search modal"
|
||||
},
|
||||
"theme.SearchModal.footer.selectText": {
|
||||
"message": "to select",
|
||||
"message": "選択",
|
||||
"description": "The explanatory text of the action for the enter key"
|
||||
},
|
||||
"theme.SearchModal.footer.selectKeyAriaLabel": {
|
||||
"message": "Enter key",
|
||||
"message": "エンターキー",
|
||||
"description": "The ARIA label for the Enter key button that makes the selection"
|
||||
},
|
||||
"theme.SearchModal.footer.navigateText": {
|
||||
"message": "to navigate",
|
||||
"message": "移動",
|
||||
"description": "The explanatory text of the action for the Arrow up and Arrow down key"
|
||||
},
|
||||
"theme.SearchModal.footer.navigateUpKeyAriaLabel": {
|
||||
"message": "Arrow up",
|
||||
"message": "上方向カーソルキー",
|
||||
"description": "The ARIA label for the Arrow up key button that makes the navigation"
|
||||
},
|
||||
"theme.SearchModal.footer.navigateDownKeyAriaLabel": {
|
||||
"message": "Arrow down",
|
||||
"message": "下方向カーソルキー",
|
||||
"description": "The ARIA label for the Arrow down key button that makes the navigation"
|
||||
},
|
||||
"theme.SearchModal.footer.closeText": {
|
||||
"message": "to close",
|
||||
"message": "閉じる",
|
||||
"description": "The explanatory text of the action for Escape key"
|
||||
},
|
||||
"theme.SearchModal.footer.closeKeyAriaLabel": {
|
||||
"message": "Escape key",
|
||||
"message": "エスケープキー",
|
||||
"description": "The ARIA label for the Escape key button that close the modal"
|
||||
},
|
||||
"theme.SearchModal.footer.searchByText": {
|
||||
"message": "Search by",
|
||||
"message": "検索エンジン",
|
||||
"description": "The text explain that the search is making by Algolia"
|
||||
},
|
||||
"theme.SearchModal.noResultsScreen.noResultsText": {
|
||||
"message": "No results for",
|
||||
"message": "検索結果はありません: ",
|
||||
"description": "The text explains that there are no results for the following search"
|
||||
},
|
||||
"theme.SearchModal.noResultsScreen.suggestedQueryText": {
|
||||
"message": "Try searching for",
|
||||
"message": "下記の検索を試してみる",
|
||||
"description": "The text for the suggested query when no results are found for the following search"
|
||||
},
|
||||
"theme.SearchModal.noResultsScreen.reportMissingResultsText": {
|
||||
"message": "Believe this query should return results?",
|
||||
"message": "このクエリは検索結果を返すべきですか?",
|
||||
"description": "The text for the question where the user thinks there are missing results"
|
||||
},
|
||||
"theme.SearchModal.noResultsScreen.reportMissingResultsLinkText": {
|
||||
"message": "Let us know.",
|
||||
"message": "お知らせください!",
|
||||
"description": "The text for the link to report missing results"
|
||||
},
|
||||
"theme.SearchModal.placeholder": {
|
||||
"message": "Search docs",
|
||||
"message": "ドキュメントを検索",
|
||||
"description": "The placeholder of the input of the DocSearch pop-up modal"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,5 +22,5 @@ The [definitive list](https://github.com/wailsapp/awesome-wails) of links relate
|
||||
- [Twitter](https://twitter.com/wailsapp)
|
||||
- [Wails Chinese Community QQ Group](https://qm.qq.com/cgi-bin/qm/qr?k=PmIURne5hFGNd7QWzW5qd6FV-INEjNJv&jump_from=webapi) - Group number: 1067173054
|
||||
|
||||
## Other Tutorials and Articles
|
||||
- [Building of Bulletin Board](https://blog.customct.com/building-bulletin-board)
|
||||
## その他のチュートリアルや記事
|
||||
- [掲示板を作ってみる](https://blog.customct.com/building-bulletin-board)
|
||||
|
||||
@@ -14,17 +14,15 @@ sidebar_position: 1
|
||||
|
||||
:::warning 注意
|
||||
|
||||
|
||||
**Wailsプロジェクトでは、サードパーティ製テンプレートのメンテナンスは行っておらず、責任も負いません!**
|
||||
|
||||
テンプレートについてよく分からない場合は、`package.json`および`wails.json`を確認し、どのようなスクリプトが実行されるのかや、どのようなパッケージがインストールされるのかを調べてください。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## Vue
|
||||
|
||||
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - Wails template based on Vue ecology (Integrated TypeScript, Dark theme, Internationalization, Single page routing, TailwindCSS)
|
||||
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - VueのエコシステムをベースにしたWailsテンプレート (TypeScript、ダークテーマ、i18n、シングルページルーティング、TailwindCSSを統合)
|
||||
- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Viteを使用したVue 3 TypeScript (および機能を追加する手順)
|
||||
- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vite、Vuex、Vue Router、SaaS、ESLint + Prettier を使用した Vue 3 TypeScript
|
||||
|
||||
@@ -37,7 +35,7 @@ sidebar_position: 1
|
||||
- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - reactjsを使用したテンプレート
|
||||
- [wails-react-template](https://github.com/flin7/wails-react-template) - ライブ開発をサポートしたReactの最小テンプレート
|
||||
- [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - Next.js、TypeScript を使用したテンプレート
|
||||
- [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - A template for React + TypeScript + Vite + TailwindCSS
|
||||
- [wails-vite-react-ts-tailwind-template](https://github.com/hotafrika/wails-vite-react-ts-tailwind-template) - React + TypeScript + Vite + TailwindCSSを使用したテンプレート
|
||||
|
||||
## Svelte
|
||||
|
||||
@@ -49,7 +47,7 @@ sidebar_position: 1
|
||||
## Elm
|
||||
|
||||
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - 関数型プログラミングと**高速な**ホットリロードを使ったGUIアプリ開発 :tada: :rocket:
|
||||
- [wails-template-elm-tailwind](https://github.com/rnice01/wails-template-elm-tailwind) - Combine the powers :muscle: of Elm + Tailwind CSS + Wails! Hot reloading supported.
|
||||
- [wails-template-elm-tailwind](https://github.com/rnice01/wails-template-elm-tailwind) - Elm + Tailwind CSS + Wailsのパワー:muscle:を組み合わせたテンプレート (ホットリロードサポートあり)
|
||||
|
||||
## ピュアJavaScript (バニラ)
|
||||
|
||||
|
||||
+10
@@ -70,6 +70,16 @@ import TabItem from "@theme/TabItem";
|
||||
|
||||
`go install github.com/wailsapp/wails/v2/cmd/wails@latest`を実行して、Wails CLIをインストールしてください。
|
||||
|
||||
Note: If you get an error similar to this:
|
||||
|
||||
```shell
|
||||
....\Go\pkg\mod\github.com\wailsapp\wails\v2@v2.1.0\pkg\templates\templates.go:28:12: pattern all:ides/*: no matching files found
|
||||
```
|
||||
please check you have Go 1.18+ installed:
|
||||
```shell
|
||||
go version
|
||||
```
|
||||
|
||||
## システムチェック
|
||||
|
||||
`wails doctor`を実行すると、必要な依存関係が正しくインストールされているかを確認することができます。 正しくインストールされていない場合は、その内容をあなたにお知らせして、どうすれば解決できるかを教えてくれます。
|
||||
|
||||
@@ -128,7 +128,6 @@ Then we would see the following:
|
||||
|
||||
:::warning
|
||||
|
||||
|
||||
Exposing your filesystem in this way is a security risk. It is recommended that you properly manage access to your filesystem.
|
||||
|
||||
:::
|
||||
|
||||
@@ -79,7 +79,6 @@ func main() {
|
||||
|
||||
:::info Fullscreen
|
||||
|
||||
|
||||
If you allow your application to go fullscreen, this drag functionality will be disabled.
|
||||
|
||||
:::
|
||||
|
||||
@@ -122,7 +122,6 @@ The `tasks.json` file is simple for the default project as there is no `npm inst
|
||||
|
||||
:::info Future Enhancement
|
||||
|
||||
|
||||
In the future, we hope to generate a `tasks.json` that includes the install and build steps automatically.
|
||||
|
||||
:::
|
||||
|
||||
@@ -98,7 +98,6 @@ Take a look at the other package managers code to get an idea how this works.
|
||||
|
||||
:::info Remember
|
||||
|
||||
|
||||
If you add support for a new package manager, don't forget to also update this page!
|
||||
|
||||
:::
|
||||
|
||||
@@ -22,12 +22,10 @@ In a standard build, all bound methods are available in the frontend under the `
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
To ensure that your application will work in obfuscated mode, you must use the generated bindings under the `wailsjs` directory in your application.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## Example
|
||||
|
||||
Importing the "Greet" method from the bindings like this:
|
||||
|
||||
@@ -103,7 +103,7 @@ jobs:
|
||||
package:
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ windows-latest, macos-latest ]
|
||||
platform: [windows-latest, macos-latest]
|
||||
go-version: [1.18]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
@@ -178,7 +178,7 @@ jobs:
|
||||
package:
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ windows-latest, macos-latest ]
|
||||
platform: [windows-latest, macos-latest]
|
||||
go-version: [1.18]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
@@ -323,7 +323,7 @@ jobs:
|
||||
package:
|
||||
strategy:
|
||||
matrix:
|
||||
platform: [ windows-latest, macos-latest ]
|
||||
platform: [windows-latest, macos-latest]
|
||||
go-version: [1.18]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
steps:
|
||||
|
||||
@@ -146,3 +146,9 @@ In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/Sy
|
||||
This is _normally_ due to a mismatch with the OS version you are running and the version of the XCode Command Line Tools installed. If you see an error like this, try upgrading your XCode Command Line Tools to the latest version.
|
||||
|
||||
Source: https://github.com/wailsapp/wails/issues/1806
|
||||
|
||||
## Cannot start service: Host version "x.x.x does not match binary version "x.x.x"
|
||||
|
||||
It's preferable to add `frontend/node_modules` and `frontend/package-lock.json` to your `.gitignore`. Otherwise when opening your repository on another machine that may have different versions of Node installed, you may not be able to run your application.
|
||||
|
||||
If this does happen, simply delete `frontend/node_modules` and `frontend/package-lock.json` and run your `wails build` or `wails dev` command again.
|
||||
@@ -108,12 +108,10 @@ var assets embed.FS
|
||||
|
||||
:::info 備考
|
||||
|
||||
|
||||
Wailsで構造体を正しくバインドするためには、構造体の*インスタンス*をオプションで指定してください。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
下記のコードでは、新しく`App`インスタンスを作成し、`wails.Run`関数の`Bind`オプションの中で、そのインスタンスを追加しています:
|
||||
|
||||
```go {16,24} title="main.go"
|
||||
@@ -230,14 +228,12 @@ export function Greet(arg1:string):Promise<string>;
|
||||
|
||||
:::info 備考
|
||||
|
||||
|
||||
Struct fields *must* have a valid `json` tag to be included in the generated Typescript.
|
||||
|
||||
Anonymous nested structs are not supported at this time.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
Goに対して引数として構造体を渡すこともできます。 構造体として取り扱ってほしいJavascriptのマップやクラスを渡すと、構造体に変換されます。 あなたが簡単にこれらのことを把握できるように、`dev`モードでは、バウンドされたGoメソッドで使用されている全構造体の型が定義された、Typescriptモジュールが生成されます。 このモジュールを使用すると、Javascriptネイティブなオブジェクトを構築し、Goコードへ送信することができます。
|
||||
|
||||
There is also support for Go methods that use structs in their signature. バインドされたメソッドで、引数または返り値として指定されているすべてのGo構造体は、Goのコードラッパーモジュールの一部として生成されたTypescript定義を持っています。 これらを使用することで、GoとJavascriptの間で、同じデータモデルを共有できます。
|
||||
|
||||
@@ -39,14 +39,12 @@ A list of community maintained templates can be found [here](../community/templa
|
||||
|
||||
:::warning 注意
|
||||
|
||||
|
||||
**Wailsプロジェクトでは、サードパーティ製テンプレートのメンテナンスは行っておらず、責任も負いません!**
|
||||
|
||||
テンプレートについてよく分からない場合は、`package.json`および`wails.json`を確認し、どのようなスクリプトが実行されるのかや、どのようなパッケージがインストールされるのかを調べてください。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## build
|
||||
|
||||
`wails build` is used for compiling your project to a production-ready binary.
|
||||
@@ -82,22 +80,22 @@ Example:
|
||||
|
||||
`wails build -clean -o myproject.exe`
|
||||
|
||||
:::info UPX on Apple Silicon
|
||||
:::Info
|
||||
On Mac, the application will be bundled with `Info.plist`, not `Info.dev.plist`.
|
||||
:::
|
||||
|
||||
:::info UPX on Apple Silicon
|
||||
|
||||
There are [issues](https://github.com/upx/upx/issues/446) with using UPX with Apple Silicon.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
:::info UPX on Windows
|
||||
|
||||
|
||||
Some Antivirus vendors false positively mark `upx` compressed binaries as virus, see [issue](https://github.com/upx/upx/issues/437).
|
||||
|
||||
:::
|
||||
|
||||
|
||||
### Platforms
|
||||
|
||||
Supported platforms are:
|
||||
@@ -162,6 +160,7 @@ Your system is ready for Wails development!
|
||||
- Javascript wrappers of your Go methods with autogenerated JSDoc, providing code hinting
|
||||
- TypeScript versions of your Go structs, that can be constructed and passed to your go methods
|
||||
- A second JS module is generated that provides a wrapper + TS declaration for the runtime
|
||||
- On macOS, it will bundle the application into a `.app` file and run it. It will use a `build/darwin/Info.dev.plist` for development.
|
||||
|
||||
| Flag | Description | Default |
|
||||
|:---------------------------- |:----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |:--------------------- |
|
||||
@@ -174,6 +173,7 @@ Your system is ready for Wails development!
|
||||
| -tags "extra tags" | Build tags to pass to compiler (quoted and space separated) | |
|
||||
| -loglevel "loglevel" | Loglevel to use - Trace, Debug, Info, Warning, Error | デバッグ |
|
||||
| -noreload | Disable automatic reload when assets change | |
|
||||
| -nocolour | Turn off colour cli output | false |
|
||||
| -nogen | Disable generate module | |
|
||||
| -v | Verbosity level (0 - silent, 1 - standard, 2 - verbose) | 1 |
|
||||
| -wailsjsdir | The directory to generate the generated Wails JS modules | Value in `wails.json` |
|
||||
|
||||
@@ -215,12 +215,10 @@ The function is given a `CallbackData` struct which indicates which menu item tr
|
||||
|
||||
:::info Roles
|
||||
|
||||
|
||||
Roles are currently supported on Mac only.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
A menu item may have a role, which is essentially a pre-defined menu item. We currently support the following roles:
|
||||
|
||||
| ロール | Description |
|
||||
|
||||
@@ -41,6 +41,8 @@ func main() {
|
||||
WindowStartState: options.Maximised,
|
||||
CSSDragProperty: "--wails-draggable",
|
||||
CSSDragValue: "drag",
|
||||
ZoomFactor: 1.0,
|
||||
IsZoomControlEnabled: false,
|
||||
Bind: []interface{}{
|
||||
app,
|
||||
},
|
||||
@@ -223,12 +225,10 @@ The menu to be used by the application. More details about Menus in the [Menu Re
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
Macでは、メニューが指定されていない場合、デフォルトメニューが作成されます。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
名前: Menu<br/> データ型: `*menu.Menu`
|
||||
|
||||
### Logger
|
||||
@@ -344,12 +344,10 @@ Setting this to `true` will make the window background translucent. 多くの場
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
この設定を適用するには、Windows 11 ビルド22621以降が必要です。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
ウィンドウの半透明タイプを設定します。 この設定は、[WindowIsTranslucent](#WindowIsTranslucent)が`true`に設定されている場合にのみ適用されます。
|
||||
|
||||
名前: BackdropType<br/> データ型: `windows.BackdropType`
|
||||
@@ -394,6 +392,18 @@ Important information about distribution of fixed version runtime:
|
||||
|
||||
名前: WebviewBrowserPath<br/> データ型: `string`
|
||||
|
||||
### ZoomFactor
|
||||
|
||||
Name: ZoomFactor<br/> Type: `float64`
|
||||
|
||||
This defines the zoom factor for the WebView2. This is the option matching the Edge user activated zoom in or out.
|
||||
|
||||
### IsZoomControlEnabled
|
||||
|
||||
Name: IsZoomControlEnabled<br/> Type: `bool`
|
||||
|
||||
This enables the zoom factor to be changed by the user. Please note that the zoom factor can be set in the options while disallowing the user to change it at runtime (f.e. for a kiosk application or similar).
|
||||
|
||||
#### Theme
|
||||
|
||||
Minimum Windows Version: Windows 10 2004/20H1
|
||||
@@ -412,12 +422,10 @@ This defines the theme that the application should use:
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
サポートされるWindowsの最小バージョン: Windows 10/11 2009/21H2 ビルド22000
|
||||
|
||||
:::
|
||||
|
||||
|
||||
Allows you to specify custom colours for TitleBar, TitleText and Border for both light and dark mode, as well as when the window is active or inactive.
|
||||
|
||||
名前: CustomTheme<br/> データ型: `windows.CustomTheme`
|
||||
|
||||
@@ -51,3 +51,5 @@ The project config resides in the `wails.json` file in the project directory. Th
|
||||
This file is read by the Wails CLI when running `wails build` or `wails dev`.
|
||||
|
||||
The `assetdir`, `reloaddirs`, `wailsjsdir`, `debounceMS`, `devserver` and `frontenddevserverurl` flags in `wails build/dev` will update the project config and thus become defaults for subsequent runs.
|
||||
|
||||
The JSON Schema for this file is located [here](https://wails.io/schemas/config.v2.json).
|
||||
|
||||
@@ -8,12 +8,10 @@ sidebar_position: 5
|
||||
|
||||
:::info Javascript
|
||||
|
||||
|
||||
現在、Javascriptランタイムではダイアログをサポートしていません。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
### OpenDirectoryDialog
|
||||
|
||||
ユーザにディレクトリの選択を求めるダイアログを開きます。 [OpenDialogOptions](#opendialogoptions)を使用してカスタマイズできます。
|
||||
|
||||
@@ -8,9 +8,9 @@ Wailsでは、GoまたはJavascriptによって発行および受信できる、
|
||||
|
||||
### EventsOn
|
||||
|
||||
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定します。 `eventName`という名前のイベントが[発行](#EventsEmit)されると、コールバックがトリガーされます。 イベント発行時にデータも付与されていた場合、そのデータはコールバックに渡されます。
|
||||
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定します。 `eventName`という名前のイベントが[発行](#EventsEmit)されると、コールバックがトリガーされます。 イベント発行時にデータも付与されていた場合、そのデータはコールバックに渡されます。 It returns a function to cancel the listener.
|
||||
|
||||
Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{}))`<br/> JS: `EventsOn(eventName string, callback function(optionalData?: any))`
|
||||
Go: `EventsOn(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`<br/> JS: `EventsOn(eventName string, callback function(optionalData?: any)): () => void`
|
||||
|
||||
### EventsOff
|
||||
|
||||
@@ -20,15 +20,15 @@ Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...st
|
||||
|
||||
### EventsOnce
|
||||
|
||||
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、一度だけトリガーさせます。
|
||||
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、一度だけトリガーさせます。 It returns a function to cancel the listener.
|
||||
|
||||
Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{}))`<br/> JS: `EventsOnce(eventName string, callback function(optionalData?: any))`
|
||||
Go: `EventsOnce(ctx context.Context, eventName string, callback func(optionalData ...interface{})) func()`<br/> JS: `EventsOnce(eventName string, callback function(optionalData?: any)): () => void`
|
||||
|
||||
### EventsOnMultiple
|
||||
|
||||
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、最大`counter`回だけトリガーします。
|
||||
このメソッドは、指定されたイベント名のイベントリスナーを新たに設定し、最大`counter`回だけトリガーします。 It returns a function to cancel the listener.
|
||||
|
||||
Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int)`<br/> JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int)`
|
||||
Go: `EventsOnMultiple(ctx context.Context, eventName string, callback func(optionalData ...interface{}), counter int) func()`<br/> JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), counter int): () => void`
|
||||
|
||||
### EventsEmit
|
||||
|
||||
|
||||
@@ -19,12 +19,10 @@ Goのランタイムは、`github.com/wailsapp/wails/v2/pkg/runtime`をインポ
|
||||
|
||||
:::info 備考
|
||||
|
||||
|
||||
[OnStartup](../options.mdx#onstartup)で提供されるContextは、ウィンドウが別のスレッドで初期化されているため、ランタイムが機能する保証がありません。 起動時にランタイムメソッドを呼び出したい場合は、[OnDomReady](../options.mdx#ondomready)を使用してください。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
Javascriptのランタイムは、`window.runtime`マップを介してフロントエンド上で利用できます。 `dev`モードでは、Typescript型定義を提供するランタイムパッケージが生成されます。 これらは、フロントエンドディレクトリの`wailsjs`ディレクトリに配置しておく必要があります。
|
||||
|
||||
### 非表示
|
||||
@@ -35,24 +33,20 @@ Go: `Hide(ctx context.Context)`<br/> JS: `Hide()`
|
||||
|
||||
:::info 備考
|
||||
|
||||
|
||||
Macでこのメソッドを使用すると、標準のMacアプリケーションにおけるメニュー項目の`Hide`と同じ方法で、アプリケーションが非表示になります。 これはウィンドウの非表示とは異なりますが、アプリケーションはフォアグラウンドに残ったままになります。 WindowsおよびLinuxでは、`WindowHide`メソッドと同等です。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
### 表示
|
||||
|
||||
アプリケーションを表示します。
|
||||
|
||||
:::info 備考
|
||||
|
||||
|
||||
Macでこのメソッドを使用すると、アプリケーションがフォアグラウンドに戻ります。 WindowsおよびLinuxでは、`WindowShow`メソッドと同等です。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
Go: `Show(ctx context.Context)`<br/> JS: `Show()`
|
||||
|
||||
### 終了
|
||||
|
||||
@@ -8,12 +8,10 @@ sidebar_position: 6
|
||||
|
||||
:::info Javascript
|
||||
|
||||
|
||||
現在、Javascriptランタイムではメニューをサポートしていません。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
### MenuSetApplicationMenu
|
||||
|
||||
指定された[menu](../menus.mdx)をアプリケーションメニューとして設定します。
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user