Merge branch 'master' into feature/1521_Support_Tray_Menus

This commit is contained in:
Lea Anthony 2022-10-15 20:30:16 +11:00 committed by GitHub
commit d7db4c1522
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
31 changed files with 8989 additions and 23474 deletions

View file

@ -55,6 +55,7 @@ func main() {
DisableWindowIcon: false,
// DisableFramelessWindowDecorations: false,
WebviewUserDataPath: "",
ZoomFactor: 1.0,
},
// Mac platform specific options
Mac: &mac.Options{

View file

@ -40,7 +40,7 @@ func AddSubcommand(app *clir.Cli, w io.Writer) error {
// For CI
ciMode := false
command.BoolFlag("ci", "CI Mode", &ciMode).Hidden()
command.BoolFlag("ci", "CI Mode", &ciMode)
// Setup project directory
projectDirectory := ""

View file

@ -56,6 +56,8 @@ func main() {
DisableWindowIcon: false,
// DisableFramelessWindowDecorations: false,
WebviewUserDataPath: "",
IsZoomControlEnabled: false,
ZoomFactor: float64,
},
Mac: &mac.Options{
TitleBar: &mac.TitleBar{

View file

@ -90,14 +90,6 @@ func CreateApp(appoptions *options.App) (*App, error) {
}
}
if assetdir == "" {
// If no assetdir has been defined, let's try to infer it from the project root and the asset FS.
assetdir, err = tryInferAssetDirFromFS(appoptions.Assets)
if err != nil {
return nil, err
}
}
if frontendDevServerURL != "" {
if devServer == "" {
return nil, fmt.Errorf("Unable to use FrontendDevServerUrl without a DevServer address")
@ -112,17 +104,27 @@ func CreateApp(appoptions *options.App) (*App, error) {
ctx = context.WithValue(ctx, "frontenddevserverurl", frontendDevServerURL)
myLogger.Info("Serving assets from frontend DevServer URL: %s", frontendDevServerURL)
} else if assetdir != "" {
// Let's override the assets to serve from on disk, if needed
absdir, err := filepath.Abs(assetdir)
if err != nil {
return nil, err
} else {
if assetdir == "" {
// If no assetdir has been defined, let's try to infer it from the project root and the asset FS.
assetdir, err = tryInferAssetDirFromFS(appoptions.Assets)
if err != nil {
return nil, err
}
}
myLogger.Info("Serving assets from disk: %s", absdir)
appoptions.Assets = os.DirFS(absdir)
if assetdir != "" {
// Let's override the assets to serve from on disk, if needed
absdir, err := filepath.Abs(assetdir)
if err != nil {
return nil, err
}
ctx = context.WithValue(ctx, "assetdir", assetdir)
myLogger.Info("Serving assets from disk: %s", absdir)
appoptions.Assets = os.DirFS(absdir)
ctx = context.WithValue(ctx, "assetdir", assetdir)
}
}
if devServer != "" {

View file

@ -88,17 +88,25 @@ func (b *Bindings) GenerateModels() ([]byte, error) {
models := map[string]string{}
var seen slicer.StringSlicer
allStructNames := b.getAllStructNames()
allStructNames.Sort()
for packageName, structsToGenerate := range b.structsToGenerateTS {
thisPackageCode := ""
w := typescriptify.New()
w.Namespace = packageName
w.WithBackupDir("")
w.KnownStructs = allStructNames
for structName, structInterface := range structsToGenerate {
// sort the structs
var structNames []string
for structName := range structsToGenerate {
structNames = append(structNames, structName)
}
sort.Strings(structNames)
for _, structName := range structNames {
fqstructname := packageName + "." + structName
if seen.Contains(fqstructname) {
continue
}
structInterface := structsToGenerate[structName]
w.Add(structInterface)
}
str, err := w.Convert(nil)

View file

@ -0,0 +1,88 @@
package binding_test
type Multistruct1 struct {
Name string `json:"name"`
}
func (s Multistruct1) Get() Multistruct1 {
return s
}
type Multistruct2 struct {
Name string `json:"name"`
}
func (s Multistruct2) Get() Multistruct2 {
return s
}
type Multistruct3 struct {
Name string `json:"name"`
}
func (s Multistruct3) Get() Multistruct3 {
return s
}
type Multistruct4 struct {
Name string `json:"name"`
}
func (s Multistruct4) Get() Multistruct4 {
return s
}
var MultistructTest = BindingTest{
name: "Multistruct",
structs: []interface{}{
&Multistruct1{},
&Multistruct2{},
&Multistruct3{},
&Multistruct4{},
},
exemptions: nil,
shouldError: false,
want: `export namespace binding_test {
export class Multistruct1 {
name: string;
static createFrom(source: any = {}) {
return new Multistruct1(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
}
}
export class Multistruct2 {
name: string;
static createFrom(source: any = {}) {
return new Multistruct2(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
}
}
export class Multistruct3 {
name: string;
static createFrom(source: any = {}) {
return new Multistruct3(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
}
}
export class Multistruct4 {
name: string;
static createFrom(source: any = {}) {
return new Multistruct4(source);
}
constructor(source: any = {}) {
if ('string' === typeof source) source = JSON.parse(source);
this.name = source["name"];
}
}
}
`,
}

View file

@ -28,6 +28,7 @@ func TestBindings_GenerateModels(t *testing.T) {
NestedFieldTest,
NonStringMapKeyTest,
SingleFieldTest,
MultistructTest,
}
testLogger := &logger.Logger{}

View file

@ -434,10 +434,19 @@ func (f *Frontend) setupChromium() {
if err != nil {
log.Fatal(err)
}
err = settings.PutIsZoomControlEnabled(false)
if err != nil {
log.Fatal(err)
if opts := f.frontendOptions.Windows; opts != nil {
if opts.ZoomFactor > 0.0 {
chromium.PutZoomFactor(opts.ZoomFactor)
}
err = settings.PutIsZoomControlEnabled(opts.IsZoomControlEnabled)
if err != nil {
log.Fatal(err)
}
}
err = settings.PutIsStatusBarEnabled(false)
if err != nil {
log.Fatal(err)

View file

@ -1,10 +1,10 @@
package edge
import (
"unsafe"
"github.com/wailsapp/wails/v2/internal/frontend/desktop/windows/go-webview2/internal/w32"
"golang.org/x/sys/windows"
"math"
"unsafe"
)
type _ICoreWebView2ControllerVtbl struct {
@ -130,3 +130,28 @@ func (i *ICoreWebView2Controller) NotifyParentWindowPositionChanged() error {
}
return nil
}
func (i *ICoreWebView2Controller) PutZoomFactor(zoomFactor float64) error {
var err error
_, _, err = i.vtbl.PutZoomFactor.Call(
uintptr(unsafe.Pointer(i)),
uintptr(math.Float64bits(zoomFactor)),
)
if err != windows.ERROR_SUCCESS {
return err
}
return nil
}
func (i *ICoreWebView2Controller) GetZoomFactor() (float64, error) {
var err error
var zoomFactorUint64 uint64
_, _, err = i.vtbl.GetZoomFactor.Call(
uintptr(unsafe.Pointer(i)),
uintptr(unsafe.Pointer(&zoomFactorUint64)),
)
if err != windows.ERROR_SUCCESS {
return 0.0, err
}
return math.Float64frombits(zoomFactorUint64), nil
}

View file

@ -372,3 +372,10 @@ func (e *Chromium) Focus() {
log.Fatal(err)
}
}
func (e *Chromium) PutZoomFactor(zoomFactor float64) {
err := e.controller.PutZoomFactor(zoomFactor)
if err != nil {
log.Fatal(err)
}
}

View file

@ -0,0 +1,32 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleName</key>
<string>{{.Info.ProductName}}</string>
<key>CFBundleExecutable</key>
<string>{{.Name}}</string>
<key>CFBundleIdentifier</key>
<string>com.wails.{{.Name}}</string>
<key>CFBundleVersion</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key>
<string>{{.Info.Comments}}</string>
<key>CFBundleShortVersionString</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleIconFile</key>
<string>iconfile</string>
<key>LSMinimumSystemVersion</key>
<string>10.13.0</string>
<key>NSHighResolutionCapable</key>
<string>true</string>
<key>NSHumanReadableCopyright</key>
<string>{{.Info.Copyright}}</string>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsLocalNetworking</key>
<true/>
</dict>
</dict>
</plist>

View file

@ -1,14 +1,27 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleName</key><string>{{.Info.ProductName}}</string>
<key>CFBundleExecutable</key><string>{{.Name}}</string>
<key>CFBundleIdentifier</key><string>com.wails.{{.Name}}</string>
<key>CFBundleVersion</key><string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key><string>{{.Info.Comments}}</string>
<key>CFBundleShortVersionString</key><string>{{.Info.ProductVersion}}</string>
<key>CFBundleIconFile</key><string>iconfile</string>
<key>LSMinimumSystemVersion</key><string>10.13.0</string>
<key>NSHighResolutionCapable</key><string>true</string>
<key>NSHumanReadableCopyright</key><string>{{.Info.Copyright}}</string>
</dict></plist>
<plist version="1.0">
<dict>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleName</key>
<string>{{.Info.ProductName}}</string>
<key>CFBundleExecutable</key>
<string>{{.Name}}</string>
<key>CFBundleIdentifier</key>
<string>com.wails.{{.Name}}</string>
<key>CFBundleVersion</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleGetInfoString</key>
<string>{{.Info.Comments}}</string>
<key>CFBundleShortVersionString</key>
<string>{{.Info.ProductVersion}}</string>
<key>CFBundleIconFile</key>
<string>iconfile</string>
<key>LSMinimumSystemVersion</key>
<string>10.13.0</string>
<key>NSHighResolutionCapable</key>
<string>true</string>
<key>NSHumanReadableCopyright</key>
<string>{{.Info.Copyright}}</string>
</dict>
</plist>

View file

@ -114,8 +114,15 @@ func packageApplicationForDarwin(options *Options) error {
}
func processPList(options *Options, contentsDirectory string) error {
sourcePList := "Info.plist"
if options.Mode == Dev {
// Use Info.dev.plist if using build mode
sourcePList = "Info.dev.plist"
}
// Read the resolved BuildAssets file and copy it to the destination
content, err := buildassets.ReadFileWithProjectData(options.ProjectData, "darwin/Info.plist")
content, err := buildassets.ReadFileWithProjectData(options.ProjectData, "darwin/"+sourcePList)
if err != nil {
return err
}

View file

@ -64,6 +64,9 @@ type Options struct {
WindowIsTranslucent bool
DisableWindowIcon bool
IsZoomControlEnabled bool
ZoomFactor float64
// Disable all window decorations in Frameless mode, which means no "Aero Shadow" and no "Rounded Corner" will be shown.
// "Rounded Corners" are only available on Windows 11.
DisableFramelessWindowDecorations bool

1
website/.npmrc Normal file
View file

@ -0,0 +1 @@
auto-install-peers=true

View file

@ -23,7 +23,7 @@ If you are unsure about a template, inspect `package.json` and `wails.json` for
## Vue
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - A template using Vite,Vue and Vue-Router(Support both JavaScript and TypeScript)
- [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-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Vue 3 TypeScript with Vite (and instructions to add features)
- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vue 3 TypeScript with Vite, Vuex, Vue Router, Sass, and ESLint + Prettier

View file

@ -160,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 |
| :--------------------------- | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :-------------------- |

View file

@ -42,6 +42,8 @@ func main() {
WindowStartState: options.Maximised,
CSSDragProperty: "--wails-draggable",
CSSDragValue: "drag",
ZoomFactor: 1.0,
IsZoomControlEnabled: false,
Bind: []interface{}{
app,
},
@ -361,6 +363,21 @@ Indicates what value the `CSSDragProperty` style should have to drag the window.
Name: CSSDragValue<br/>
Type: `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).
### Bind
A slice of struct instances defining methods that need to be bound to the frontend.

View file

@ -16,6 +16,23 @@ const config = {
organizationName: "wailsapp",
projectName: "wails",
webpack: {
jsLoader: (isServer) => ({
loader: require.resolve('swc-loader'),
options: {
jsc: {
parser: {
syntax: 'typescript',
tsx: true,
},
target: 'es2017',
},
module: {
type: isServer ? 'commonjs' : 'es6',
},
},
}),
},
i18n: {
defaultLocale: "en",
locales: ["en", "zh-Hans", "ja"],

View file

@ -2,53 +2,54 @@
sidebar_position: 1
---
# Templates
# テンプレート
This page serves as a list for community supported templates. Please submit a PR (click `Edit this page` at the bottom) to include your templates. To build your own template, please see the [Templates](../guides/templates.mdx) guide.
このページでは、コミュニティがサポートしているテンプレートを紹介しています。 このページに新たにテンプレートを含めたい場合は、このページの下側にある`このページを編集`をクリックして、プルリクエストを出してください。 独自テンプレートの作成方法については、[テンプレート](../guides/templates.mdx)ガイドをご覧ください。
To use these templates, run `wails init -n "Your Project Name" -t [the link below[@version]]`
これらのテンプレートを使用するには、`wails init -n "プロジェクト名" -t [テンプレートのリンク[@バージョン]]`コマンドを実行してください。
If there is no version suffix, the main branch code template is used by default. If there is a version suffix, the code template corresponding to the tag of this version is used.
バージョンサフィックスが無い場合は、デフォルトで、メインブランチのコードテンプレートが使用されます。 バージョンサフィックスがある場合は、当該バージョンのタグに対応するコードテンプレートが使用されます。
Example: `wails init -n "Your Project Name" -t https://github.com/misitebao/wails-template-vue`
例: `wails init -n "プロジェクト名" -t https://github.com/misitebao/wails-template-vue`
:::warning Attention
:::warning 注意
**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!**
**Wailsプロジェクトでは、サードパーティ製テンプレートのメンテナンスは行っておらず、責任も負いません!**
If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed.
テンプレートについてよく分からない場合は、`package.json`および`wails.json`を確認し、どのようなスクリプトが実行されるのかや、どのようなパッケージがインストールされるのかを調べてください。
:::
## Vue
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - A template using Vite,Vue and Vue-Router(Support both JavaScript and TypeScript)
- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - Vue 3 TypeScript with Vite (and instructions to add features)
- [wails-vite-vue-the-works](https://github.com/codydbentley/wails-vite-vue-the-works) - Vue 3 TypeScript with Vite, Vuex, Vue Router, Sass, and ESLint + Prettier
- [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-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
## Angular
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - Angular with TypeScript, Sass, Hot-Reload, Code-Splitting and i18n
- [wails-angular-template](https://github.com/TAINCER/wails-angular-template) - TypeScript、Sass、ホットリロード、コード分割、i18n を使用した Angular
## React
- [wails-react-template](https://github.com/AlienRecall/wails-react-template) - A template using reactjs
- [wails-react-template](https://github.com/flin7/wails-react-template) - A minimal template for React that supports live development
- [wails-template-nextjs](https://github.com/LGiki/wails-template-nextjs) - A template using Next.js and TypeScript
- [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
## Svelte
- [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - A template using Svelte
- [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - A template using Svelte and Vite
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - A template using Svelte and Vite with TailwindCSS v3
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - A template using SvelteKit
- [wails-svelte-template](https://github.com/raitonoberu/wails-svelte-template) - Svelteを使用したテンプレート
- [wails-vite-svelte-template](https://github.com/BillBuilt/wails-vite-svelte-template) - SvelteおよびViteを使用したテンプレート
- [wails-vite-svelte-tailwind-template](https://github.com/BillBuilt/wails-vite-svelte-tailwind-template) - TailwindCSS v3を含んだ、SvelteおよびViteを使用したテンプレート
- [wails-sveltekit-template](https://github.com/h8gi/wails-sveltekit-template) - SvelteKitを使用したテンプレート
## Elm
- [wails-elm-template](https://github.com/benjamin-thomas/wails-elm-template) - Develop your GUI app with functional programming and a **snappy** hot-reload setup :tada: :rocket:
- [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.
## ピュアJavaScript (バニラ)

View file

@ -1,4 +1,4 @@
# Templates
# テンプレート
Wails generates projects from pre-created templates. In v1, this was a difficult to maintain set of projects that were subject to going out of date. In v2, to empower the community, a couple of new features have been added for templates:

View file

@ -8,16 +8,16 @@ Wailsは、Go言語とWeb技術を使用して、デスクトップアプリの
"Goの力によって、Electronが軽量かつ高速になったようなもの"、と考えるとよいでしょう。 Goの柔軟性とパワーに、リッチでモダンなフロントエンドを組み合わせたアプリを、簡単に構築することができます。
### 機能
### Features
- ネイティブなメニュー、ダイアログ、テーマ、透過を使用できます
- Windows、macOS、Linuxをサポートしています
- Svelte、React、Preact、Vue、Lit、Vanilla JS向けのテンプレートを用意しています
- JavascriptからGoのメソッドを簡単に呼び出せます
- Go構造体からTypescriptの型を自動的に生成します
- Windowsでは、CGOや外部DLLを用意する必要はありません
- Native Menus, Dialogs, Theming and Translucency
- Windows, macOS and linux support
- Built in templates for Svelte, React, Preact, Vue, Lit and Vanilla JS
- Easily call Go methods from Javascript
- Automatic Go struct to Typescript model generation
- No CGO or external DLLs required on Windows
- [Vite](https://vitejs.dev/)の力を利用したライブ開発が可能です
- 簡単にアプリを生成、ビルド、パッケージ化できる強力なCLIを用意しています
- Powerful CLI to easily Create, Build and Package applications
- 豊富な[ランタイムライブラリ](/docs/reference/runtime/intro)を用意しています
- Wailsで構築されたアプリケーションは、Apple StoreおよびMicrosoft Storeに準拠しています

View file

@ -37,12 +37,12 @@ Remote templates (hosted on GitHub) are supported and can be installed by using
A list of community maintained templates can be found [here](../community/templates.mdx)
:::warning Attention
:::warning 注意
**The Wails project does not maintain, is not responsible nor liable for 3rd party templates!**
**Wailsプロジェクトでは、サードパーティ製テンプレートのメンテナンスは行っておらず、責任も負いません!**
If you are unsure about a template, inspect `package.json` and `wails.json` for what scripts are run and what packages are installed.
テンプレートについてよく分からない場合は、`package.json`および`wails.json`を確認し、どのようなスクリプトが実行されるのかや、どのようなパッケージがインストールされるのかを調べてください。
:::

View file

@ -36,6 +36,14 @@ Go: `WindowIsFullscreen(ctx context.Context) bool`<br/> JS: `WindowIsFullscreen(
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
### WindowExecJS
Executes arbitrary JS code in the window.
This method runs the code in the browser asynchronously and returns immediately. If the script causes any errors, they will only be available in the browser console.
Go: `WindowExecJS(ctx context.Context, js string)`
### WindowReload
リロードします。(現在表示されているページをリロード)

View file

@ -24,8 +24,8 @@ sidebar_position: 1
## Vue
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - 基于 Vite、Vue 和 Vue-Router 的 Wails 模板(同时支持 JavaScript 和 TypeScript
- [wails-vite-vue-ts](https://github.com/codydbentley/wails-vite-vue-ts) - 使用 Vite 的 Vue 3 TypeScript(以及添加功能的说明)
- [wails-template-vue](https://github.com/misitebao/wails-template-vue) - 基于 Vue 生态的 Wails 模板(集成 TypeScript、黑暗主题、国际化、单页路由、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, Sass, 和 ESLint + Prettier 的 Vue 3 TypeScript
## Angular
@ -49,7 +49,8 @@ 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) - 结合 Elm + Tailwind CSS + Wails 的力量 :muscle: 支持热重载。
## Pure JavaScript (Vanilla)
## JavaScript (Vanilla)
- [wails-pure-js-template](https://github.com/KiddoV/wails-pure-js-template) - 一个只有基本 JavaScript、HTML 和 CSS 的模板

View file

@ -36,6 +36,14 @@ Go: `WindowIsFullscreen(ctx context.Context) bool`<br/> JS: `WindowIsFullscreen(
Go: `WindowCenter(ctx context.Context)`<br/> JS: `WindowCenter()`
### 窗口执行JS代码
在窗口中执行任意 JS 代码。
此方法在浏览器中异步运行代码并立即返回。 如果脚本导致任何错误,它们将只在浏览器控制台中可用。
Go: `WindowExecJS(ctx context.Context, js string)`
### 窗口重新加载
执行“重新加载”(重新加载当前页面)。

23384
website/package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -20,13 +20,14 @@
"@docusaurus/preset-classic": "^2.1.0",
"@docusaurus/theme-search-algolia": "^2.1.0",
"@mdx-js/react": "^1.6.22",
"@wails/react-contributors": "^1.1.3",
"clsx": "^1.1.1",
"@swc/core": "^1.3.7",
"clsx": "^1.2.1",
"file-loader": "^6.2.0",
"prism-react-renderer": "^1.2.1",
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-responsive-carousel": "^3.2.23"
"prism-react-renderer": "^1.3.5",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-responsive-carousel": "^3.2.23",
"swc-loader": "^0.2.3"
},
"browserslist": {
"production": [
@ -41,7 +42,7 @@
]
},
"devDependencies": {
"@crowdin/cli": "^3.8.0",
"@crowdin/cli": "^3.8.1",
"prettier": "^2.7.1"
}
}

8650
website/pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load diff

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 127 KiB

After

Width:  |  Height:  |  Size: 124 KiB

Before After
Before After

View file

@ -41,4 +41,4 @@ JS: `EventsOnMultiple(eventName string, callback function(optionalData?: any), c
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))`
JS: `EventsEmit( eventName string, optionalData function(optionalData?: any))`