Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CodeQL / Analyze (${{ matrix.language }}) (none, javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
CI / CI OK (push) Has been cancelled
43 lines
1.4 KiB
Markdown
43 lines
1.4 KiB
Markdown
# Project Guidelines
|
||
|
||
## 技术栈
|
||
|
||
- Vue 3 + TypeScript + Ant Design Vue + vxe-table 4.x + Vben Admin 5.x
|
||
- Pinia (setup store) + Vue Router 4 + Vite + pnpm monorepo
|
||
- 路径别名 `#/*` → `./src/*`,不使用 `@/`
|
||
|
||
## 代码风格
|
||
|
||
- 所有组件使用 `<script setup lang="ts">`,禁止 Options API
|
||
- 类型导入使用 `import type`
|
||
- API 文件使用 `namespace` 模式定义请求/响应类型,函数名以 `Api` 结尾(如 `getListApi`)
|
||
- Store 使用 `defineStore` + setup 函数风格,命名 `use[Feature]Store`
|
||
- UI 文本使用中文
|
||
|
||
## 项目结构
|
||
|
||
```
|
||
src/api/core/ → API 接口(按资源分文件)
|
||
src/model/ → TypeScript 类型定义
|
||
src/store/ → Pinia Store
|
||
src/router/routes/ → 路由(core + modules/ 动态加载)
|
||
src/views/ → 页面(按功能模块分目录)
|
||
src/adapter/ → VxeTable / Form 适配器
|
||
src/component/ → 可复用业务组件
|
||
```
|
||
|
||
## 构建与运行
|
||
|
||
```bash
|
||
pnpm dev # 启动开发服务器
|
||
pnpm build:antd # 生产构建
|
||
pnpm typecheck # TypeScript 类型检查
|
||
```
|
||
|
||
## 约定
|
||
|
||
- 新增页面流程:API → Model → Store(可选)→ Route → View
|
||
- 表格使用 `useVbenVxeGrid`,表单使用 `useVbenForm`,弹窗使用 `useVbenModal`
|
||
- API 代理:`/api` → `http://localhost:5320/api`
|
||
- 路由模块放在 `src/router/routes/modules/`,使用 `import.meta.glob` 自动加载
|