Private
Public Access
1
0

新增:文档体系重构+CHANGELOG补充+发布产物清理

This commit is contained in:
2026-05-01 22:22:06 +08:00
parent 3e1a540b83
commit 6eaaa56eb6
164 changed files with 40346 additions and 64 deletions

View File

@@ -50,7 +50,7 @@ npm install
npm run build
```
这会生成 `web/dist` 目录,包含前端构建产物。
这会生成 `frontend/dist` 目录,包含前端构建产物。
### 4. 开发模式运行
@@ -79,7 +79,7 @@ wails dev
## 常见问题
### 问题1找不到 web/dist 目录
### 问题1找不到 frontend/dist 目录
**解决**:需要先构建前端
```bash

View File

@@ -38,7 +38,7 @@ go-desk/
├── wails.json # Wails 配置文件
├── go.mod # Go 模块依赖
├── go.sum # Go 依赖校验
├── web/ # 前端代码目录
├── frontend/ # 前端代码目录
│ ├── package.json # 前端依赖配置
│ ├── package-lock.json # 依赖锁定文件
│ ├── vite.config.js # Vite 构建配置
@@ -62,8 +62,8 @@ go-desk/
**目录说明:**
- `app.go`: 定义应用结构体和方法,供前端调用
- `main.go`: 程序入口,配置窗口、资源等
- `web/`: 前端 Vue 项目,使用 Vite 构建
- `web/dist/`: 前端构建产物,会被嵌入到 Go 二进制文件
- `frontend/`: 前端 Vue 项目,使用 Vite 构建
- `frontend/dist/`: 前端构建产物,会被嵌入到 Go 二进制文件
- `build/`: 应用图标等构建资源
## 配置调整
@@ -87,7 +87,7 @@ cd web
npm install --save @arco-design/web-vue
```
### 3. 修改 `web/src/main.js`
### 3. 修改 `frontend/src/main.js`
```javascript
import { createApp } from 'vue'
@@ -101,7 +101,7 @@ app.use(ArcoVue)
app.mount('#app')
```
### 4. 修改 `web/src/App.vue`
### 4. 修改 `frontend/src/App.vue`
```vue
<template>
@@ -217,7 +217,7 @@ import (
"github.com/wailsapp/wails/v2/pkg/options/assetserver"
)
//go:embed all:web/dist
//go:embed all:frontend/dist
var assets embed.FS
func main() {
@@ -280,7 +280,7 @@ wails build -platform linux/amd64
## 注意事项
1. **前端构建**:每次修改前端代码后需要重新构建 `npm run build`Wails 会使用 `web/dist` 目录
1. **前端构建**:每次修改前端代码后需要重新构建 `npm run build`Wails 会使用 `frontend/dist` 目录
2. **Go 方法暴露**:在 `app.go` 中定义的方法会自动暴露给前端,通过 `window.go.main.MethodName` 调用
3. **热重载**开发模式下Go 代码修改需要重启 `wails dev`,前端代码修改需要重新构建
4. **资源嵌入**:使用 `//go:embed` 将前端构建产物嵌入到 Go 二进制文件中

View File

@@ -252,7 +252,7 @@ go-desk/
│ └── filesystem/
│ └── fs.go # 文件系统操作
├── app.go # 添加系统调用方法
└── web/src/
└── frontend/src/
└── components/
├── SystemInfo.vue # 系统信息组件
└── FileSystem.vue # 文件系统组件