VueVite启动器

vue-h5-template — Vue 启动器模板

作者 fonghehe

基于 Vue 3、TypeScript 与 Turborepo 的移动端 H5 启动模板,同时提供 NutUI、Vant、Varlet 三套 UI 框架版本。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

3 个预览视图
桌面端首页1 / 3
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 3

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-03查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

Turborepo + pnpm workspace 的 monorepo 结构,同一仓库内并行维护 NutUI、Vant、Varlet 三套 H5 应用

02

三套应用共享首页、列表、会员、商品详情与购物车、请求演示、流式聊天等视图,同时保留各自的导航与组件展示

03

内置 Nitro 模拟后端,提供登录与商品接口以及 user/admin 测试账号,无需真实后端即可启动

04

包含 Pinia 持久化、TanStack Vue Query 缓存与分页示例、OpenAPI 生成的接口类型、统一错误处理

05

移动端处理较完整:safe-area、Visual Viewport、下拉刷新、Web Share、剪贴板、离线状态、错误边界与持久化购物车

06

支持简中、繁中、英文、日文国际化,语言选择与文档语言、路由标题、UI 文案、Mock 商品语言保持同步

模板详细介绍

这是一个面向移动端 H5 的启动模板,采用 Turborepo + pnpm workspace 的 monorepo 结构,仓库内包含 apps/h5-nutui、apps/h5-vant、apps/h5-varlet 三个独立 H5 应用,以及 backend-mock(Nitro 模拟服务)、docs(VitePress 文档)和 packages 下的共享包(api-client、stores、locales、styles、utils、ai-chat、@core 等)。三个应用共享首页、列表、会员、示例、商品详情与购物车、请求演示、流式聊天等视图,同时各自保留本框架的导航与组件展示,并使用各自的主题 token(Vant 蓝、NutUI 红、Varlet 紫)。

技术层面使用 Vue 3 + TypeScript + Vite,配合 Pinia(含持久化插件)、Vue Router、TanStack Vue Query、Axios、Vue I18n、UnoCSS,以及 postcss-mobile-forever 做视口适配(375px 设计稿、最大 600px)。模板内置 Nitro 模拟后端(含登录与商品接口,提供 user/admin 测试账号)、非生产环境的 Eruda 调试面板、OpenAPI 生成接口契约、SSE/ReadableStream 的流式 AI 聊天客户端,以及 safe-area、下拉刷新、Web Share、剪贴板、离线状态、错误边界等移动端常见处理。国际化支持简体中文、繁体中文、英文、日文,默认英文,可在会员页切换。

使用限制:需要 Node.js 22.18.0 及以上、pnpm 11.0.0 及以上;生产目标为 Chrome/Android WebView 111+ 与 Safari/iOS WebView 16.4+,不支持 IE 与旧版 Android WebView。开发默认走内置 Mock;若要连接配套的 business-service(:8002)与 ai-service(:8001)需另行启动后端并使用 dev:services:* 脚本。仓库采用 MIT 许可,但演示图片、字体、图标等第三方素材需单独核对许可,域名、托管、数据库等外部服务可能另行收费。

VueVite启动器

适合你的项目吗?

适用场景

  • 需要快速搭建移动端 H5 项目骨架,并希望从 NutUI、Vant、Varlet 中挑选一套 UI 组件库
  • 在同一个仓库中对比或并行维护多套 UI 框架的 H5 实现,共享请求层、状态管理与样式基础
  • 为已有 H5 项目引入流式 AI 聊天、服务端状态缓存、接口契约生成等基础设施参考
  • 需要一套包含 Mock 后端、文档站、统一 lint 与提交规范的移动端工程化起点

适合人群

  • 使用 Vue 3 + TypeScript 开发移动端 H5 的团队或个人开发者
  • 需要在 NutUI、Vant、Varlet 之间做选型或同时维护多套 UI 版本的项目
  • 希望以 monorepo 方式组织多应用与共享包的前端工程
  • 需要移动端调试、视口适配、国际化等基础能力已就位的启动项目

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    环境要求 Node.js >= 22.18.0、pnpm >= 11.0.0 与 Git

  2. 2

    克隆仓库后执行 pnpm install,再用 pnpm dev 交互选择应用,或直接运行 pnpm dev:nutui / dev:vant / dev:varlet

  3. 3

    开发默认使用内置 Nitro Mock;连接配套 business-service(:8002) 与 ai-service(:8001) 时需先启动后端,再运行 pnpm dev:services:vant|nutui|varlet

  4. 4

    构建可用 pnpm build 或 pnpm build:nutui|vant|varlet,质量检查用 pnpm check,端到端测试用 pnpm test:e2e

  5. 5

    Mock 测试账号为 user/123456(普通用户)与 admin/123456(管理员)

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 开发默认使用内置 Nitro Mock;若要连接配套的 business-service(:8002) 与 ai-service(:8001),需另行启动这两个后端服务,并使用 dev:services:* 脚本运行。
  • 运行环境要求 Node.js 22.18.0 及以上、pnpm 11.0.0 及以上,低于该版本无法正常安装与启动。
  • 生产目标仅支持 Chrome/Android WebView 111+ 与 Safari/iOS WebView 16.4+,不支持 IE 与旧版 Android WebView。
  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

Development uses the built-in Nitro mock by default. To connect the companion `vue-h5-template-business-service` (`:8002`) and `vue-h5-template-ai-service` (`:8001`), start both backends and run `pnpm dev:services:vant`

README 原文

- [Node.js](https://nodejs.org/) >= 22.18.0 - [pnpm](https://pnpm.io/) >= 11.0.0

README 原文

The production target is Chrome/Android WebView 111+ and Safari/iOS WebView 16.4+. Recent WeChat and WeCom WebViews on those engines are supported. IE and legacy Android WebView are not supported.

README 原文
https://github.com/fonghehe/vue-h5-template/blob/main/LICENSEhttps://github.com/fonghehe/vue-h5-template/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-03。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 92 / 100
技术栈
Vue · Vite
网站类型
启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-09-11
截图检查日期
2026-10-03

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Vue。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: [email protected] · 2026-10-04

查看当时使用的来源资料

SHA-256: 4e225339e7275fffb8b1983fd4c0db0ea6d20c4c2e4ef8e92a0a7d8998e90031

2026-10-03T18:57:30.719Z

来源文件 / 仓库
<div align="center">

<h1>Vue H5 Template</h1>

Mobile H5 development template based on Vue 3 + TypeScript + Turborepo

English | [简体中文](./README.zh-CN.md) | [日本語](./README.ja-JP.md) | [繁體中文(台)](./README.zh-TW.md) | [繁體中文(港)](./README.zh-HK.md)

</div>

## Consistent mobile experience

All three apps now share Home / List / Member / Examples, product details and cart, Query and request demos, and streaming chat. Native navigation and component showcases retain each framework’s identity; shared views use each app’s own theme tokens.

English is the default. Change to Chinese or Japanese from Member; the choice, document language, route titles, UI copy and Mock product language stay synchronized. The floating AI button opens Chat above the bottom tabs and hides on Member and input/checkout routes. Catalog cards preserve real 44px touch targets, including at 320px.

Both Mock and the separate AI/business services work with all three targets. Run `pnpm test:e2e` to check Vant, NutUI and Varlet. See [UI architecture](docs/src/guide/v2/ui-framework.md).

## Introduction

Vue H5 Template is a free and open-source mobile H5 development template built on Turborepo Monorepo architecture, using the latest Vue 3, Vite, TypeScript, and other mainstream technology stacks. It provides H5 app templates for three UI frameworks: NutUI, Vant, and Varlet.

## Features

- **Monorepo Architecture** — Managed with Turborepo + pnpm workspace for multiple H5 apps and shared packages
- **Three UI Frameworks** — NutUI, Vant, and Varlet versions available for flexible UI choices
- **Independent visual systems** — Coherent Vant blue, NutUI red, and Varlet purple tokens without cross-framework color leakage
- **Type-safe infrastructure** — Strict TypeScript, explicit lazy routes, OpenAPI-generated contracts, and normalized API errors
- **Streaming AI Chat** — Provider-neutral SSE/ReadableStream client with AbortController and sanitized Markdown
- **Server state** — TanStack Vue Query examples for cache, mutation, pagination, and infinite queries
- **Mobile production baseline** — Safe areas, keyboard-friendly chat input, optional PWA, and production-only image optimization
- **Product-ready mobile patterns** — Error boundary, offline status, Visual Viewport, pull-to-refresh, Web Share, clipboard, and persisted cart flow
- **Vite Build** — Vite-based build configuration with auto-import and component auto-registration
- **UnoCSS** — Atomic CSS engine for utility-first styling across all apps
- **State Management** — Pinia with persistence plugin, AES encryption in production
- **Mock Server** — Nitro-based mock backend with authentication and product APIs
- **Eruda** — Built-in mobile debugging console (non-production only)
- **Unified Standards** — Shared ESLint / OxLint / Stylelint / Oxfmt / Commitlint configurations
- **Mobile Adaptation** — postcss-mobile-forever for responsive viewport adaptation (375px design, 600px max)
- **Internationalization** — Supports Simplified Chinese, Traditional Chinese, English, and Japanese

## Tech Stack

| Technology          | Version | Description                  |
| ------------------- | ------- | ---------------------------- |
| Vue 3               | 3.5     | Frontend framework           |
| TypeScript          | 6.0     | Type safety                  |
| Vite                | 8.1     | Build tool                   |
| UnoCSS              | 66.x    | Atomic CSS engine            |
| Turborepo           | 2.10     | Monorepo management          |
| pnpm                | 11.10   | Package manager              |
| Pinia               | 4.0     | State management             |
| Vue Router          | 5.0     | Routing                      |
| TanStack Vue Query  | 5.x     | Server state and cache       |
| Axios               | 1.x     | Typed REST transport         |
| Vue I18n            | 11.4    | Internationalization         |
| Nitro               | 2.x     | Mock server                  |
| NutUI               | 4.3     | UI component library         |
| Vant                | 4.10     | UI component library         |
| Varlet              | 3.19    | UI component library         |
| VueUse              | 14.x    | Composition utilities        |
| Eruda               | 3.x     | Mobile debug console         |

## Prerequisites

- [Node.js](https://nodejs.org/) >= 22.18.0
- [pnpm](https://pnpm.io/) >= 11.0.0
- [Git](https://git-scm.com/)

## Getting Started

```bash
# Clone the project
git clone https://github.com/fonghehe/vue-h5-template.git
cd vue-h5-template

# Install dependencies
pnpm install

# Start development (interactive app selection)
pnpm dev

# Start a specific app
pnpm dev:nutui    # NutUI version
pnpm dev:vant     # Vant version
pnpm dev:varlet   # Varlet version
```

Development uses the built-in Nitro mock by default. To connect the companion `vue-h5-template-business-service` (`:8002`) and `vue-h5-template-ai-service` (`:8001`), start both backends and run `pnpm dev:services:vant`, `pnpm dev:services:nutui`, or `pnpm dev:services:varlet`. See the [request architecture](https://fonghehe.github.io/vue-h5-template/guide/v2/request) for routing and environment variables.

## Build

```bash
# Build all apps
pnpm build

# Build a specific app
pnpm build:nutui
pnpm build:vant
pnpm build:varlet

# Build documentation
pnpm build:docs

# Complete quality gate (lint + types + unit tests + build)
pnpm check
pnpm test:e2e

# Regenerate API contracts / inspect bundles
pnpm api:generate
pnpm build:analyze
```

## Project Structure

```
vue-h5-template/
├── apps/
│   ├── backend-mock/       # Nitro mock server
│   ├── h5-nutui/           # NutUI H5 app (port 5777)
│   ├── h5-vant/            # Vant H5 app (port 5778)
│   └── h5-varlet/          # Varlet H5 app (port 5779)
├── docs/                   # VitePress documentation
├── internal/
│   ├── lint-configs/       # ESLint, OxLint, Stylelint, Oxfmt, Commitlint configs
│   ├── node-utils/         # Node.js utilities
│   ├── tsconfig/           # Shared TypeScript configs
│   └── vite-config/        # Shared Vite configuration
├── packages/
│   ├── @core/              # Core packages (base/shared, design, typings, composables)
│   ├── ai-chat/            # Provider-neutral streaming chat
│   ├── api-client/         # Axios client and OpenAPI-generated types
│   ├── locales/            # i18n locale messages
│   ├── stores/             # Pinia stores
│   ├── styles/             # Shared styles
│   └── utils/              # Shared utilities
├── openapi/                # Demo backend contract
├── scripts/                # Build scripts and CLI tools
└── AGENTS.md               # Architecture rules for coding agents
```

## Test Accounts

The mock server provides the following test accounts:

| Username | Password | Role         |
| -------- | -------- | ------------ |
| user     | 123456   | Regular user |
| admin    | 123456   | Admin        |

## Documentation

- [Online Documentation](https://fonghehe.github.io/vue-h5-template/)

## Browser Support

The production target is Chrome/Android WebView 111+ and Safari/iOS WebView 16.4+. Recent WeChat and WeCom WebViews on those engines are supported. IE and legacy Android WebView are not supported.

| [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/edge/edge_48x48.png" alt=" Edge" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Edge | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png" alt="Firefox" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Firefox | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png" alt="Chrome" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Chrome | [<img src="https://raw.githubusercontent.com/alrra/browser-logos/master/src/safari/safari_48x48.png" alt="Safari" width="24px" height="24px" />](http://godban.github.io/browsers-support-badges/)</br>Safari |
| --- | --- | --- | --- |
| Edge ≥ 111 | Firefox ≥ 115 | Chrome ≥ 111 | Safari ≥ 16.4 |

## Contributing

Contributions are welcome! Please refer to the [Contributing Guide](https://github.com/fonghehe/vue-h5-template/blob/main/CONTRIBUTING.md).

Git commit messages should follow the [Conventional Commits](https://www.conventionalcommits.org/) specification.

## License

[MIT](./LICENSE)
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。