mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-03 00:09:56 +08:00
docs: sync documents (#2013)
This commit is contained in:
parent
6d94cb4afe
commit
00864fa14f
@ -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 (バニラ)
|
||||
|
||||
|
@ -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)をアプリケーションメニューとして設定します。
|
||||
|
@ -194,12 +194,10 @@ R、G、B、Aの有効な値の範囲は0~255です。
|
||||
|
||||
:::info Windows
|
||||
|
||||
|
||||
Windowsの場合、0または255のアルファ値(A) のみがサポートされています。 0以外の値を指定すると、すべて255とみなされます。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
||||
|
||||
## Typescript型定義
|
||||
|
@ -17,12 +17,10 @@ sidebar_position: 20
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
This tutorial has been kindly provided by [@tatadan](https://twitter.com/tatadan) and forms part of their [Wails Examples Repository](https://github.com/tataDan/wails-v2-examples).
|
||||
|
||||
:::
|
||||
|
||||
|
||||
In this tutorial we are going to develop an application that retrieves photos of dogs from the web and then displays them.
|
||||
|
||||
### Create the project
|
||||
@ -236,8 +234,6 @@ Add the following lines to `frontend/src/App.svelte`:
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Testing the application
|
||||
|
@ -12,12 +12,10 @@ The aim of this tutorial is to get you up and running with the most basic applic
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
This tutorial uses Windows as the target platform. Output will vary slightly depending on your operating system.
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## Create a new Wails application
|
||||
|
||||
To create a new Wails application using the default vanilla JS template, you need to run the following command:
|
||||
|
@ -12,7 +12,7 @@
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
"message": "Runtime",
|
||||
"message": "ランタイム",
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
|
@ -12,7 +12,7 @@
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
"message": "Runtime",
|
||||
"message": "ランタイム",
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
|
@ -4,35 +4,35 @@
|
||||
"description": "The label for version v2.1.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "はじめよう",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "リファレンス",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
"message": "Runtime",
|
||||
"message": "ランタイム",
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "コミュニティ",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "事例紹介",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
"message": "Guides",
|
||||
"message": "ガイド",
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "チュートリアル",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "コントリビューション",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,62 @@ All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## v2.1.0 - 2022-10-18
|
||||
|
||||
### Added
|
||||
* [Support for defaulting to No button in Windows dialogs](https://wails.io/docs/reference/runtime/dialog/#windows) - @leaanthony in https://github.com/wailsapp/wails/pull/1875
|
||||
* Add missing resize for frameless window on Linux - @Lyimmi in https://github.com/wailsapp/wails/pull/1918
|
||||
* [Add window transparency for linux](https://wails.io/docs/reference/options#windowistranslucent-2) - @Lyimmi in https://github.com/wailsapp/wails/pull/1926
|
||||
* [Add WindowExecJS method](https://wails.io/docs/reference/runtime/window#windowexecjs) - @leaanthony in https://github.com/wailsapp/wails/pull/1927
|
||||
* [Add support for `Info.dev.plist` on macOS](https://wails.io/docs//reference/cli#dev) - @leaanthony in https://github.com/wailsapp/wails/pull/1960
|
||||
* [Add ZoomFactor get/set and add the respective windows only options](https://wails.io/docs/reference/options#zoomfactor) - @pierrejoye in https://github.com/wailsapp/wails/pull/1463
|
||||
|
||||
### Fixed
|
||||
* Embed directories auto-created if they don't exist - @leaanthony in https://github.com/wailsapp/wails/pull/1983
|
||||
* Quote command arguments if they have a space - @leaanthony in https://github.com/wailsapp/wails/pull/1892
|
||||
* Fixed Linux frameless window drag - @Lyimmi in https://github.com/wailsapp/wails/pull/1916
|
||||
* Fix gtk_window_begin_resize_drag's mouse button - @Lyimmi in https://github.com/wailsapp/wails/pull/1920
|
||||
* Fix binding generation special cases - @JulioDRF in https://github.com/wailsapp/wails/pull/1902
|
||||
* Remove the `.git` directory in the template - @misitebao in https://github.com/wailsapp/wails/pull/1929
|
||||
* Fix wails dev - @JulioDRF in https://github.com/wailsapp/wails/pull/1931
|
||||
* Fix for considering new `go` files in dev filesystem watcher - @scottopell in https://github.com/wailsapp/wails/pull/1946
|
||||
* Prevent type parsing to interfere with Typescript package name - @ValentinTrinque in https://github.com/wailsapp/wails/pull/1942
|
||||
* [dev] Do not try to infer assetdir from fs.FS when a frontend dev server is in use - @stffabi in https://github.com/wailsapp/wails/pull/1972
|
||||
* Fix init command not listed in wails help message - @lyon-lee-dev in https://github.com/wailsapp/wails/pull/1976
|
||||
|
||||
### Changed
|
||||
* Add PR checks - @leaanthony in https://github.com/wailsapp/wails/pull/1879
|
||||
* Auto label project cards - @leaanthony in https://github.com/wailsapp/wails/pull/1881
|
||||
* Add issue translator - @leaanthony in https://github.com/wailsapp/wails/pull/1891
|
||||
* Update label names in the issue template - @misitebao in https://github.com/wailsapp/wails/pull/1893
|
||||
* obfuscated instead of obfuscate in the docs - @arifali123 in https://github.com/wailsapp/wails/pull/1895
|
||||
* [assetHandler] Remove redundant log prefix - @stffabi in https://github.com/wailsapp/wails/pull/1896
|
||||
* [dev] Do not generate bindings in the dev app itself - @stffabi in https://github.com/wailsapp/wails/pull/1899
|
||||
* Update Chinese translation - @almas1992 in https://github.com/wailsapp/wails/pull/1894
|
||||
* Refactor app - @leaanthony in https://github.com/wailsapp/wails/pull/1909
|
||||
* Update documents - @misitebao in https://github.com/wailsapp/wails/pull/1907 https://github.com/wailsapp/wails/pull/1936
|
||||
* Adding Tutorial link - @raguay in https://github.com/wailsapp/wails/pull/1903
|
||||
* Add react-ts-vite-tailwind template - @hotafrika in https://github.com/wailsapp/wails/pull/1930
|
||||
* Update README.zh-Hans.md - @o8x in https://github.com/wailsapp/wails/pull/1949
|
||||
* Add Elm Tailwind CSS community template - @rnice01 in https://github.com/wailsapp/wails/pull/1939
|
||||
* Chore/generate sponsors - @leaanthony in https://github.com/wailsapp/wails/pull/1965
|
||||
* Use swc + pnpm for website - @leaanthony in https://github.com/wailsapp/wails/pull/1966
|
||||
* Sort structs in models.ts - @leaanthony in https://github.com/wailsapp/wails/pull/1961
|
||||
* Update Sponsor Image - @github-actions in https://github.com/wailsapp/wails/pull/1973
|
||||
* docs: sync documents - @misitebao in https://github.com/wailsapp/wails/pull/1968
|
||||
* Update events.mdx - @cuigege in https://github.com/wailsapp/wails/pull/1979
|
||||
|
||||
## New Contributors
|
||||
* @arifali123 made their first contribution in https://github.com/wailsapp/wails/pull/1895
|
||||
* @almas1992 made their first contribution in https://github.com/wailsapp/wails/pull/1894
|
||||
* @JulioDRF made their first contribution in https://github.com/wailsapp/wails/pull/1902
|
||||
* @hotafrika made their first contribution in https://github.com/wailsapp/wails/pull/1930
|
||||
* @scottopell made their first contribution in https://github.com/wailsapp/wails/pull/1946
|
||||
* @o8x made their first contribution in https://github.com/wailsapp/wails/pull/1949
|
||||
* @rnice01 made their first contribution in https://github.com/wailsapp/wails/pull/1939
|
||||
* @cuigege made their first contribution in https://github.com/wailsapp/wails/pull/1979
|
||||
* @lyon-lee-dev made their first contribution in https://github.com/wailsapp/wails/pull/1976
|
||||
|
||||
## v2.0.0 - 2022-09-22
|
||||
|
||||
## Fixed
|
||||
|
@ -70,8 +70,10 @@
|
||||
|
||||
## 帰属
|
||||
|
||||
この行動規範は、https://www.contributor-covenant.org/version/2/0/code_of_conduct.html で利用可能な [Contributor Covenant](https://www.contributor-covenant.org) バージョン 2.0 を基に作成されています。
|
||||
この行動規範は、https://www.contributor-covenant.org/version/2/0/code_of_conduct.html で利用可能な [Contributor Covenant][homepage] バージョン 2.0 を基に作成されています。
|
||||
|
||||
コミュニティへの影響ガイドラインは[Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity)に適合しています。
|
||||
|
||||
この行動規範に関する一般的な質問への回答については、https://www.contributor-covenant.org/faq の FAQ を参照してください。 翻訳はhttps://www.contributor-covenant.org/translations で入手できます。
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
@ -54,17 +54,13 @@ We are always keen to add features to Wails and expand on what the project can d
|
||||
- Once all the testing is completed, please update the status of the PR from draft and leave a message.
|
||||
|
||||
:::note
|
||||
|
||||
There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all enhancement requests are reviewed for good fit. Not all ideas will be selected, so it's best to have discussion about the enhancement first.
|
||||
:::
|
||||
|
||||
|
||||
:::warning
|
||||
|
||||
Any PRs opened without a corresponding ticket may be rejected.
|
||||
:::
|
||||
|
||||
|
||||
### Fixing Bugs
|
||||
|
||||
The process for fixing bugs are as follows:
|
||||
@ -81,17 +77,13 @@ The process for fixing bugs are as follows:
|
||||
- Once all the testing is completed, please update the status of the PR from draft and leave a message.
|
||||
|
||||
:::note
|
||||
|
||||
There is nothing stopping you from opening a ticket and working on it yourself, but please be aware that all bugfixes should be discussed as the approach may have unintended side effects.
|
||||
:::
|
||||
|
||||
|
||||
:::warning
|
||||
|
||||
Any PRs opened without a corresponding ticket may be rejected.
|
||||
:::
|
||||
|
||||
|
||||
### Testing
|
||||
|
||||
Testing is vitally important to ensure quality in the project. There are a couple of scenarios where testing can really help the project:
|
||||
@ -144,7 +136,6 @@ To join the Wails slack channel, accept the invite [here](https://gophers.slack.
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
Work In Progress
|
||||
|
||||
:::
|
||||
|
@ -14,14 +14,12 @@ sidebar_position: 1
|
||||
|
||||
:::warning 注意
|
||||
|
||||
|
||||
**Wails 项目不维护也不对第 3 方模板负责**
|
||||
|
||||
如果您不确定某个模板,请检查 `package.json` 和 `wails.json` 中安装的模块和运行的脚本。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## Vue
|
||||
|
||||
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - 基于 Vue 生态的 Wails 模板(集成 TypeScript、黑暗主题、国际化、单页路由、TailwindCSS)
|
||||
|
@ -69,6 +69,16 @@ import TabItem from "@theme/TabItem";
|
||||
|
||||
运行 `go install github.com/wailsapp/wails/v2/cmd/wails@latest` 安装 Wails CLI。
|
||||
|
||||
注意:如果您遇到了类似于以下内容的错误:
|
||||
|
||||
```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
|
||||
```
|
||||
请检查您是否已安装 Go 1.18+ ︰
|
||||
```shell
|
||||
go version
|
||||
```
|
||||
|
||||
## 系统检查
|
||||
|
||||
运行 `wails doctor` 将检查您是否安装了正确的依赖项。 如果没有,它会就缺少的内容提供建议以帮助纠正问题。
|
||||
|
@ -128,7 +128,6 @@ let response = await fetch('does-not-exist.txt');
|
||||
|
||||
:::warning
|
||||
|
||||
|
||||
以这种方式暴露您的文件系统是一种安全风险。 建议您正确管理对文件系统的访问。
|
||||
|
||||
:::
|
||||
|
@ -79,7 +79,6 @@ func main() {
|
||||
|
||||
:::info 全屏
|
||||
|
||||
|
||||
如果您允许您的应用程序全屏显示,则此拖动功能将被禁用。
|
||||
|
||||
:::
|
||||
|
@ -122,7 +122,6 @@ Wails 旨在提供出色的开发体验。 为此,我们现在支持生成 IDE
|
||||
|
||||
:::info 功能增强
|
||||
|
||||
|
||||
将来,我们希望生成一个 `tasks.json` 自动包含安装和构建步骤的文件。
|
||||
|
||||
:::
|
||||
|
@ -98,7 +98,6 @@ type PackageManager interface {
|
||||
|
||||
:::info 记住
|
||||
|
||||
|
||||
如果您添加了对新包管理器的支持,请不要忘记更新此页面!
|
||||
|
||||
:::
|
||||
|
@ -22,12 +22,10 @@ wails build -obfuscated -garbleargs "-literals -tiny -seed=myrandomseed"
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
为确保您的应用程序在混淆模式下工作,您必须使用 `wailsjs` 应用程序目录下生成的绑定。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## 示例
|
||||
|
||||
从绑定中导入“Greet” 方法,如下所示:
|
||||
|
@ -146,3 +146,9 @@ In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/Sy
|
||||
这 _通常_ 是由于您正在运行的操作系统版本和安装的 XCode 命令行工具的版本不匹配。 如果您看到这样的错误,请尝试将您的 XCode 命令行工具升级到最新版本。
|
||||
|
||||
来源:https://github.com/wailsapp/wails/issues/1806
|
||||
|
||||
## 无法启动服务:主机版本“x.x.x”与二进制版本“x.x.x”不匹配
|
||||
|
||||
最好将 `frontend/node_modules` 和 `frontend/package-lock.json` 添加到您的 `.gitignore` 中。 否则,当在另一台可能安装了不同版本 Node 的机器上打开您的存储库时,您可能无法运行您的应用程序。
|
||||
|
||||
如果发生这种情况,只需删除 `frontend/node_modules` 和 `frontend/package-lock.json` 并再次运行 `wails build` 或 `wails dev` 命令。
|
@ -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 注意
|
||||
|
||||
|
||||
结构体字段 *必须* 具有有效的 `json` 标签,以包含在生成的 TypeScript 中。
|
||||
|
||||
目前不支持嵌套匿名结构体。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
也可以将结构体发送回 Go。 作为期望的结构体的参数传递的任何 Javascript map/class 都将转换为该结构体类型。 为了使这个过程更容易,在 `开发` 模式下,会生成一个 TypeScript 模块,声明绑定方法中使用的所有结构体类型。 使用此模块,可以构建原生 Javascript 对象并将其发送到 Go 代码。
|
||||
|
||||
还支持在其签名中使用结构的 Go 方法。 绑定方法(作为参数或返回类型)指定的所有 Go 结构体都将作为 Go 代码包装器模块的一部分自动生成 Typescript 版本。 使用这些,可以在 Go 和 Javascript 之间共享相同的数据模型。
|
||||
|
@ -39,14 +39,12 @@ Wails CLI 有许多用于管理项目的命令。 所有命令都以此方式运
|
||||
|
||||
:::warning 注意
|
||||
|
||||
|
||||
**Wails 项目不维护也不对第 3 方模板负责**
|
||||
|
||||
如果您不确定某个模板,请检查 `package.json` 和 `wails.json` 中安装的模块和运行的脚本。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## 构建
|
||||
|
||||
`wails build` 用于将您的项目编译为生产可用的二进制文件。
|
||||
@ -82,22 +80,22 @@ Wails CLI 有许多用于管理项目的命令。 所有命令都以此方式运
|
||||
|
||||
`wails build -clean -o myproject.exe`
|
||||
|
||||
:::info 苹果芯片上的 UPX
|
||||
:::Info
|
||||
在 Mac 上,应用程序将与 `Info.plist` 捆绑在一起,而不是 `Info.dev.plist`。
|
||||
:::
|
||||
|
||||
:::info 苹果芯片上的 UPX
|
||||
|
||||
在苹果芯片上使用 UPX 相关的 [问题](https://github.com/upx/upx/issues/446)。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
:::info Windows 上的 UPX
|
||||
|
||||
|
||||
一些防病毒软件供应商误将 `upx` 压缩的二进制文件标记为病毒,请查看相关 [问题](https://github.com/upx/upx/issues/437)。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
### 平台
|
||||
|
||||
支持的平台有:
|
||||
@ -162,6 +160,7 @@ Your system is ready for Wails development!
|
||||
- 带有自动生成的 JSDoc 的 Go 方法的 Javascript 包装器,提供代码提示
|
||||
- 您的 Go 结构体的 TypeScript 版本,可以构造并传递给您的 Go 方法
|
||||
- 生成的第二个 JS 模块,为运行时提供包装器 + TS 声明
|
||||
- 在 macOS 上,它会将应用程序打包到一个 `.app` 文件并运行它。 开发模式它将使用 `build/darwin/Info.dev.plist` 。
|
||||
|
||||
| 标志 | 描述 | 默认 |
|
||||
|:---------------------------- |:-------------------------------------------------------------------------------------------------------------------------------- |:----------------- |
|
||||
@ -174,6 +173,7 @@ Your system is ready for Wails development!
|
||||
| -tags "额外标签" | 传递给编译器的构建标签(引号和空格分隔) | |
|
||||
| -loglevel "日志级别" | 要使用的日志级别 - Trace, Debug, Info, Warning, Error | Debug(调试) |
|
||||
| -noreload | 资产更改时禁用自动重新加载 | |
|
||||
| -nocolour | 关闭彩色命令行输出 | false |
|
||||
| -nogen | 禁用生成模块 | |
|
||||
| -v | 详细级别 (0 - silent, 1 - standard, 2 - verbose) | 1 |
|
||||
| -wailsjsdir | 生成生成的Wails JS模块的目录 | `wails.json` 中的值 |
|
||||
|
@ -215,12 +215,10 @@ type CallbackData struct {
|
||||
|
||||
:::info 角色
|
||||
|
||||
|
||||
目前仅 Mac 支持角色。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
一个菜单项可能有一个角色,它本质上是一个预定义的菜单项。 我们目前支持以下角色:
|
||||
|
||||
| 角色 | 描述 |
|
||||
|
@ -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 @@ func main() {
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
在 Mac 上,如果未指定菜单,将创建一个默认菜单。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
名称:Menu<br/> 类型:`*menu.Menu`
|
||||
|
||||
### 日志
|
||||
@ -344,12 +344,10 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) {
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
需要 Windows 11 build 22621 或更高版本。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
设置窗口的半透明类型。 这仅在 [窗口半透明](#窗口半透明) 设置为 `true` 时适用。
|
||||
|
||||
名称:BackdropType<br/> 类型:`windows.BackdropType`
|
||||
@ -394,6 +392,18 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) {
|
||||
|
||||
名称:WebviewBrowserPath<br/> 类型:`string`
|
||||
|
||||
### 缩放比例
|
||||
|
||||
名称:ZoomFactor<br/> 类型:`float64`
|
||||
|
||||
这定义了 WebView2 的缩放比例。 这是匹配 Edge 用户激活放大或缩小的选项
|
||||
|
||||
### 启用缩放比例
|
||||
|
||||
名称:IsZoomControlEnabled<br/> 类型:`bool`
|
||||
|
||||
这将允许用户更改缩放比例。 请注意,可以在选项中设置缩放比例,但不允许在运行时更改它。 适用于屏幕固定的或类似的应用程序。
|
||||
|
||||
#### 主题
|
||||
|
||||
最低 Windows 版本:Windows 10 2004/20H1
|
||||
@ -412,12 +422,10 @@ func (b *App) beforeClose(ctx context.Context) (prevent bool) {
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
最低 Windows 版本:Windows 10/11 2009/21H2 Build 22000
|
||||
|
||||
:::
|
||||
|
||||
|
||||
允许您为浅色和深色模式以及窗口处于活动或非活动状态的 TitleBar、TitleText 和 Border 指定自定义颜色。
|
||||
|
||||
名称:CustomTheme<br/> 类型:`windows.CustomTheme`
|
||||
|
@ -51,3 +51,5 @@ sidebar_position: 5
|
||||
该文件将在运行 `wails build` 或 `wails dev` 时,由 Wails CLI 读取。
|
||||
|
||||
`wails build/dev` 命令中的 `assetdir`、`reloaddirs`、`wailsjsdir`、`debounceMS`、`devserver` 和 `frontenddevserverurl` 标志将覆盖项目配置并作为后续运行的默认值。
|
||||
|
||||
此文件的 JSON 模型位于 [此处](https://wails.io/schemas/config.v2.json)。
|
||||
|
@ -8,12 +8,10 @@ sidebar_position: 5
|
||||
|
||||
:::info Javascript
|
||||
|
||||
|
||||
JS 运行时当前不支持对话框。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
### 打开选择目录对话框
|
||||
|
||||
打开一个对话框,提示用户选择目录。 可以使用 [ 打开选择文件对话框参数选项](#打开选择文件对话框参数选项) 进行自定义。
|
||||
|
@ -8,9 +8,9 @@ Wails 运行时提供了一个统一的事件系统,其中事件可以由 Go
|
||||
|
||||
### 添加事件侦听器
|
||||
|
||||
此方法为给定的事件名称设置一个侦听器。 当 [触发指定事件](#触发指定事件) 名为 `eventName` 类型的事件时,将触发回调。 与触发事件一起发送的任何其他数据都将传递给回调。
|
||||
此方法为给定的事件名称设置一个侦听器。 当 [触发指定事件](#触发指定事件) 名为 `eventName` 类型的事件时,将触发回调。 与触发事件一起发送的任何其他数据都将传递给回调。 它返回 一个函数来取消侦听器。
|
||||
|
||||
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`
|
||||
|
||||
### 移除事件侦听器
|
||||
|
||||
@ -20,15 +20,15 @@ Go: `EventsOff(ctx context.Context, eventName string, additionalEventNames ...st
|
||||
|
||||
### 添加只触发一次的事件侦听器
|
||||
|
||||
此方法为给定的事件名称设置一个侦听器,但只会触发一次。
|
||||
此方法为给定的事件名称设置一个侦听器,但只会触发一次。 它返回 一个函数来取消侦听器。
|
||||
|
||||
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`
|
||||
|
||||
### 添加指定对多触发次数的事件侦听器
|
||||
|
||||
此方法为给定的事件名称设置一个侦听器,但最多只能触发 `counter` 次。
|
||||
此方法为给定的事件名称设置一个侦听器,但最多只能触发 `counter` 次。 它返回 一个函数来取消侦听器。
|
||||
|
||||
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`
|
||||
|
||||
### 触发指定事件
|
||||
|
||||
|
@ -19,12 +19,10 @@ Go 运行时可通过导入 `github.com/wailsapp/wails/v2/pkg/runtime` 获取。
|
||||
|
||||
:::info 注意
|
||||
|
||||
|
||||
虽然上下文将提供给 [应用启动回调](../../reference/options#应用启动回调) 方法,但不能保证运行时将在此方法中工作,因为窗口正在不同的线程中初始化。 如果您希望在启动时调用运行时方法,请使用 [前端 Dom 加载完成回调](../../reference/options#前端-dom-加载完成回调) 方法。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
Javascript 库可通过 `window.runtime` 提供给前端。 使用 `开发` 模式时会生成一个运行时包,该包为运行时提供 Typescript 声明。 这应该位于您的前端目录的`wailsjs`目录中。
|
||||
|
||||
### 隐藏
|
||||
@ -35,24 +33,20 @@ Go: `Hide(ctx context.Context)`<br/> JS: `Hide()`
|
||||
|
||||
:::info 注意
|
||||
|
||||
|
||||
`Hide` 在 Mac 上,这将以与标准 Mac 应用程序中的菜单项相同的方式隐藏应用程序。 这与隐藏窗口不同,但应用程序仍处于前台。 对于 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
|
||||
|
||||
|
||||
JS 运行时当前不支持菜单。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
### 设置应用程序菜单
|
||||
|
||||
将应用程序菜单设置为给定的 [菜单](../menus.mdx)。
|
||||
|
@ -194,12 +194,10 @@ R、G、B 和 A 的有效值为 0-255。
|
||||
|
||||
:::info Windows
|
||||
|
||||
|
||||
在 Windows 上,仅支持 0 或 255 的 alpha 值。 任何非 0 的值都将被视为 255。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
||||
|
||||
## Typescript 对象定义
|
||||
|
@ -17,12 +17,10 @@ sidebar_position: 20
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
本教程由 [@tatadan](https://twitter.com/tatadan) 友情提供,是他们的 [Wails Examples Repository](https://github.com/tataDan/wails-v2-examples) 的一部分。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
在本教程中,我们将开发一个应用程序,从网络上检索狗的照片,然后显示它们。
|
||||
|
||||
### 创建项目
|
||||
@ -236,8 +234,6 @@ import (
|
||||
}
|
||||
</style>
|
||||
```
|
||||
|
||||
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### 创建应用程序
|
||||
|
@ -12,12 +12,10 @@ sidebar_position: 10
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
本教程使用 Windows 作为目标平台。 根据您的操作系统,输出会略有不同。
|
||||
|
||||
:::
|
||||
|
||||
|
||||
## 创建一个新的 Wails 应用
|
||||
|
||||
使用默认的 vanilla JS 模板创建新的 Wails 程序, 您需要运行这个指令:
|
||||
|
@ -4,35 +4,35 @@
|
||||
"description": "The label for version v2.1.0"
|
||||
},
|
||||
"sidebar.docs.category.Getting Started": {
|
||||
"message": "Getting Started",
|
||||
"message": "快速入门",
|
||||
"description": "The label for category Getting Started in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Reference": {
|
||||
"message": "Reference",
|
||||
"message": "参考",
|
||||
"description": "The label for category Reference in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Runtime": {
|
||||
"message": "Runtime",
|
||||
"message": "运行时",
|
||||
"description": "The label for category Runtime in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Community": {
|
||||
"message": "Community",
|
||||
"message": "社区",
|
||||
"description": "The label for category Community in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Showcase": {
|
||||
"message": "Showcase",
|
||||
"message": "案例展示",
|
||||
"description": "The label for category Showcase in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Guides": {
|
||||
"message": "Guides",
|
||||
"message": "指南",
|
||||
"description": "The label for category Guides in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.category.Tutorials": {
|
||||
"message": "Tutorials",
|
||||
"message": "教程",
|
||||
"description": "The label for category Tutorials in sidebar docs"
|
||||
},
|
||||
"sidebar.docs.link.Contributing": {
|
||||
"message": "Contributing",
|
||||
"message": "参与贡献",
|
||||
"description": "The label for link Contributing in sidebar docs, linking to /community-guide#ways-of-contributing"
|
||||
}
|
||||
}
|
||||
|
@ -4,6 +4,62 @@
|
||||
|
||||
格式基于 [维护更新日志](https://keepachangelog.com/en/1.0.0/),并且该项目遵循 [语义化版本](https://semver.org/spec/v2.0.0.html)。
|
||||
|
||||
## v2.1.0 - 2022-10-18
|
||||
|
||||
### 新增
|
||||
* [Support for defaulting to No button in Windows dialogs](https://wails.io/docs/reference/runtime/dialog/#windows) - @leaanthony in https://github.com/wailsapp/wails/pull/1875
|
||||
* Add missing resize for frameless window on Linux - @Lyimmi in https://github.com/wailsapp/wails/pull/1918
|
||||
* [Add window transparency for linux](https://wails.io/docs/reference/options#windowistranslucent-2) - @Lyimmi in https://github.com/wailsapp/wails/pull/1926
|
||||
* [Add WindowExecJS method](https://wails.io/docs/reference/runtime/window#windowexecjs) - @leaanthony in https://github.com/wailsapp/wails/pull/1927
|
||||
* [Add support for `Info.dev.plist` on macOS](https://wails.io/docs//reference/cli#dev) - @leaanthony in https://github.com/wailsapp/wails/pull/1960
|
||||
* [Add ZoomFactor get/set and add the respective windows only options](https://wails.io/docs/reference/options#zoomfactor) - @pierrejoye in https://github.com/wailsapp/wails/pull/1463
|
||||
|
||||
### 修复
|
||||
* Embed directories auto-created if they don't exist - @leaanthony in https://github.com/wailsapp/wails/pull/1983
|
||||
* Quote command arguments if they have a space - @leaanthony in https://github.com/wailsapp/wails/pull/1892
|
||||
* Fixed Linux frameless window drag - @Lyimmi in https://github.com/wailsapp/wails/pull/1916
|
||||
* Fix gtk_window_begin_resize_drag's mouse button - @Lyimmi in https://github.com/wailsapp/wails/pull/1920
|
||||
* Fix binding generation special cases - @JulioDRF in https://github.com/wailsapp/wails/pull/1902
|
||||
* Remove the `.git` directory in the template - @misitebao in https://github.com/wailsapp/wails/pull/1929
|
||||
* Fix wails dev - @JulioDRF in https://github.com/wailsapp/wails/pull/1931
|
||||
* Fix for considering new `go` files in dev filesystem watcher - @scottopell in https://github.com/wailsapp/wails/pull/1946
|
||||
* Prevent type parsing to interfere with Typescript package name - @ValentinTrinque in https://github.com/wailsapp/wails/pull/1942
|
||||
* [dev] Do not try to infer assetdir from fs.FS when a frontend dev server is in use - @stffabi in https://github.com/wailsapp/wails/pull/1972
|
||||
* Fix init command not listed in wails help message - @lyon-lee-dev in https://github.com/wailsapp/wails/pull/1976
|
||||
|
||||
### 变更
|
||||
* Add PR checks - @leaanthony in https://github.com/wailsapp/wails/pull/1879
|
||||
* Auto label project cards - @leaanthony in https://github.com/wailsapp/wails/pull/1881
|
||||
* Add issue translator - @leaanthony in https://github.com/wailsapp/wails/pull/1891
|
||||
* Update label names in the issue template - @misitebao in https://github.com/wailsapp/wails/pull/1893
|
||||
* obfuscated instead of obfuscate in the docs - @arifali123 in https://github.com/wailsapp/wails/pull/1895
|
||||
* [assetHandler] Remove redundant log prefix - @stffabi in https://github.com/wailsapp/wails/pull/1896
|
||||
* [dev] Do not generate bindings in the dev app itself - @stffabi in https://github.com/wailsapp/wails/pull/1899
|
||||
* Update Chinese translation - @almas1992 in https://github.com/wailsapp/wails/pull/1894
|
||||
* Refactor app - @leaanthony in https://github.com/wailsapp/wails/pull/1909
|
||||
* Update documents - @misitebao in https://github.com/wailsapp/wails/pull/1907 https://github.com/wailsapp/wails/pull/1936
|
||||
* Adding Tutorial link - @raguay in https://github.com/wailsapp/wails/pull/1903
|
||||
* Add react-ts-vite-tailwind template - @hotafrika in https://github.com/wailsapp/wails/pull/1930
|
||||
* Update README.zh-Hans.md - @o8x in https://github.com/wailsapp/wails/pull/1949
|
||||
* Add Elm Tailwind CSS community template - @rnice01 in https://github.com/wailsapp/wails/pull/1939
|
||||
* Chore/generate sponsors - @leaanthony in https://github.com/wailsapp/wails/pull/1965
|
||||
* Use swc + pnpm for website - @leaanthony in https://github.com/wailsapp/wails/pull/1966
|
||||
* Sort structs in models.ts - @leaanthony in https://github.com/wailsapp/wails/pull/1961
|
||||
* Update Sponsor Image - @github-actions in https://github.com/wailsapp/wails/pull/1973
|
||||
* docs: sync documents - @misitebao in https://github.com/wailsapp/wails/pull/1968
|
||||
* Update events.mdx - @cuigege in https://github.com/wailsapp/wails/pull/1979
|
||||
|
||||
## 新贡献者
|
||||
* @arifali123 made their first contribution in https://github.com/wailsapp/wails/pull/1895
|
||||
* @almas1992 made their first contribution in https://github.com/wailsapp/wails/pull/1894
|
||||
* @JulioDRF made their first contribution in https://github.com/wailsapp/wails/pull/1902
|
||||
* @hotafrika made their first contribution in https://github.com/wailsapp/wails/pull/1930
|
||||
* @scottopell made their first contribution in https://github.com/wailsapp/wails/pull/1946
|
||||
* @o8x made their first contribution in https://github.com/wailsapp/wails/pull/1949
|
||||
* @rnice01 made their first contribution in https://github.com/wailsapp/wails/pull/1939
|
||||
* @cuigege made their first contribution in https://github.com/wailsapp/wails/pull/1979
|
||||
* @lyon-lee-dev made their first contribution in https://github.com/wailsapp/wails/pull/1976
|
||||
|
||||
## v2.0.0 - 2022-09-22
|
||||
|
||||
## 修复
|
||||
|
@ -54,17 +54,13 @@ Wails 是一个开放源码、社区驱动的项目。 我们欢迎任何人加
|
||||
- 完成所有测试后,请从草稿更新 PR 的状态并留言。
|
||||
|
||||
:::note
|
||||
|
||||
没有什么可以阻止您新开 Issue 并自己处理,但请注意,所有增强请求都经过审核以确保合适。 并非所有的想法都会被选中,因此最好先对新功能讨论一下。
|
||||
没有什么可以阻止你自己开一个个 Issue,但是请注意,对改进请求进行审查,以确定是否合适。 并非所有的想法都会被选中,因此最好先对新功能讨论一下。
|
||||
:::
|
||||
|
||||
|
||||
:::warning
|
||||
|
||||
任何没有相应 Issue 的 PR 都可能被拒绝。
|
||||
任何没有相对应 Issue 的打开的 PR 可能会被拒绝。
|
||||
:::
|
||||
|
||||
|
||||
### 修复漏洞
|
||||
|
||||
修复bug的流程如下:
|
||||
@ -81,17 +77,13 @@ Wails 是一个开放源码、社区驱动的项目。 我们欢迎任何人加
|
||||
- 完成所有测试后,请从草稿更新 PR 的状态并留言。
|
||||
|
||||
:::note
|
||||
|
||||
没有什么可以阻止您开 Issue 并自己处理,但请注意,所有错误修复都应该讨论,因为该方法可能会产生意想不到的副作用。
|
||||
没有什么可以阻止你自己开一个 Issue,但是请注意,应该讨论所有的错误修复,因为这种方法可能会产生意想不到的副作用。
|
||||
:::
|
||||
|
||||
|
||||
:::warning
|
||||
|
||||
任何没有相应 Issue 的 PR 都可能被拒绝。
|
||||
任何没有相对应 Issue 的打开的 PR 可能会被拒绝。
|
||||
:::
|
||||
|
||||
|
||||
### 测试
|
||||
|
||||
测试对于确保项目的质量至关重要。 有几个场景可以让测试真正帮助项目:
|
||||
@ -113,7 +105,7 @@ Wails 是一个开放源码、社区驱动的项目。 我们欢迎任何人加
|
||||
|
||||
要设置本地文档开发环境,请执行以下操作:
|
||||
|
||||
- [Install npm](https://docs.npmjs.com/cli/v8/configuring-npm/install)
|
||||
- [安装 NPM](https://docs.npmjs.com/cli/v8/configuring-npm/install)
|
||||
- `cd website`
|
||||
- `npm install`
|
||||
- `npm run start`
|
||||
@ -144,7 +136,6 @@ Wails 项目的默认文档是英文文档。 我们使用“crowdin”工具将
|
||||
|
||||
:::note
|
||||
|
||||
|
||||
正在开发
|
||||
|
||||
:::
|
||||
|
Loading…
Reference in New Issue
Block a user