Files
zMainPage/README.md
Zikai 6ad6c15e9d feat: 拆分移动游戏项目为独立 z449 子模块(git submodule + i18n prop 桥接)
- mobile-game 模块源码迁出至独立仓库 z449(third_party/z449),独立可渲染/维护
- z449 App.vue 为便携式组件:自带独立 vue-i18n 实例与 locale 文案
- mainPage 侧 MobileGameWrapper 透传 :locale prop,子模块 watch 同步语言
- mainPage i18n 精简:仅保留 tabs.mobileGame,删除 mobileGame.* 大块文案
- 文档:新增 docs/submodule-z449.md,更新 README/architecture/add-module
2026-07-23 07:04:08 +00:00

104 lines
4.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# mainPage · 作品集主页
Zikai 的作品集主页 -- Vue 3 模块化多项目展示站。浅色极简、中英双语(英文按需懒加载)。
每个项目页签是一个独立「模块」,由注册表自动生成页签与路由 -- 新增/删除页签只增删一个文件夹,互不影响。
> 架构细节、新增页签指南、子项目管理见 [`docs/`](./docs/)。
---
## 项目结构
```
mainPage/
├── index.html
├── package.json # 含 ical.jstimeTableFix 依赖、vue-i18nz449 嵌入时共享)
├── vite.config.js # 构建输出到 /root/htmlemptyOutDir=false不清空既有文件
├── .gitmodules # git submodulethird_party/timeTableFix
├── README.md
├── docs/ # 架构 / 新增页签 / 子模块管理文档
├── public/favicon.svg
├── third_party/
│ ├── timeTableFix/ # ★ git submoduleICS 日程整理器,独立仓库
│ └── z449/ # ★ git submodule移动游戏项目展示页独立仓库
└── src/
├── main.js # 应用入口(挂载 i18n / router / 全局样式)
├── App.vue # 根布局:顶栏 + 标签导航 + <KeepAlive router-view> + 页脚
├── config/
│ └── app.config.js # 集中配置:外部服务 URL白板地址 / 存活探针等)
├── i18n/ # 国际化(中文同步注入;英文动态 import() 懒加载)
├── router/index.js # 路由表由模块注册表自动生成
├── modules/ # ★ 扩展点:每个页签一个文件夹
│ ├── index.js # 注册表import.meta.glob 约定式收集,带容错)
│ ├── mobile-game/ # 移动游戏项目页签
│ ├── whiteboard/ # 共享记事本页签iframe 嵌入 + 存活校验)
│ ├── timetable/ # 日程整理页签(构建期 import 子模块 App.vue
│ └── calendar/ # 隐藏页(仅手动访问 /cqy
├── components/ # 共享组件TabNav / LanguageSwitcher / ui 基元含 PageShell
├── composables/ # useProjects / useLiveness / useI18nLazy / useLocale
└── styles/ # variables.css主题令牌+ base.css
```
## 依赖的基础设施
| 项 | 要求 |
|---|---|
| Node.js | ≥ 18开发于 18.19 + npm 9.2 |
| Web 服务器 | Apache 2.4(启用 `mod_rewrite`),对外静态服务 `/root/html` |
| SPA 回退 | history 模式需站点根 `.htaccess` 回退到 `index.html`(见下) |
> 共享记事本页签 iframe 嵌入外部服务(`https://f.zikai.wang/wb/share`URL 在 `src/config/app.config.js` 配置。
> 日程整理页签timeTableFix经 git submodule 构建期集成(非 iframe详见 [`docs/submodule-timeTableFix.md`](./docs/submodule-timeTableFix.md)。
> 移动游戏项目页签z449同样经 git submodule 构建期集成,子模块自带独立 i18n经 `:locale` prop 同步父项目语言,详见 [`docs/submodule-z449.md`](./docs/submodule-z449.md)。
## Ubuntu 从 0 安装
```bash
# 1. 安装 Node.js 18
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash -
sudo apt-get install -y nodejs
# 2. 取代码(含子模块 timeTableFix / z449
git clone --recursive https://git.zikai.wang/zikai/zMainPage.git mainPage
cd mainPage
# 若已 clone 但未带子模块git submodule update --init --recursive
npm install
# 子模块 z449 需各自安装依赖(构建期编译其 .vue
(cd third_party/z449 && npm install)
# 3. 构建(产物输出到 /root/html不清空既有文件
npm run build
# 4. 安装并启用 Apache
sudo apt-get install -y apache2
sudo a2enmod rewrite
```
站点根放 `.htaccess`Apache 需 `AllowOverride All`)做 SPA 回退:
```apache
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^ index.html [L]
```
`/root/html`(或 `/var/www/html`)设为 `DocumentRoot`,访问站点即可。
## 开发命令
```bash
npm install # 首次安装依赖
npm run dev # 开发服务器 http://localhost:5173
npm run build # 构建到 /root/html
npm run preview # 本地预览构建产物
```
## 了解更多
- [架构(模块注册 / PageShell / KeepAlive / 存活校验)](./docs/architecture.md)
- [如何新增一个项目页签](./docs/add-module.md)
- [子项目 timeTableFix 管理submodule 升级 / 移除)](./docs/submodule-timeTableFix.md)
- [子项目 z449 管理submodule + i18n prop 桥接)](./docs/submodule-z449.md)