2025-03-29 14:35:49 +08:00

38 lines
659 B
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 4-wails
官网: wails.io
## 安装
如果是用homebrew安装的go, 记得添加环境变量
```sh
# go
PATH=~/go/bin:$PATH
```
## 创建项目
```sh
wails init -n myproject -t vanilla
```
* `/main.go` - 主应用
* `/frontend/` - 前端项目文件
* `/build/` - 项目构建目录
* `/build/appicon.png` - 应用程序图标
* `/build/darwin/` - Mac 特定的项目文件
* `/build/windows/` - Windows 特定的项目文件
* `/wails.json` - 项目配置
* `/go.mod` - Go module 文件
* `/go.sum` - Go module 校验文件
## 开发模式
```sh
wails dev
```
## api
js 方法挂在 `window.runtime` 上. 例如 `window.runtime.Quit()`