可快速搭建基于 Vue 3 和 Vite 的前端开发环境,包含路由配置、Pinia 状态管理、TypeScript 支持及规范的目录结构,助力高效开发与团队协作。【此简介由AI生成】
| Files | Last commit | Last update |
|---|---|---|
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago | ||
| 10 months ago |
vue-ai-lhx
This template should help get you started developing with Vue 3 in Vite.
Recommended IDE Setup
VS Code + Vue (Official) (and disable Vetur).
Recommended Browser Setup
- Chromium-based browsers (Chrome, Edge, Brave, etc.):
- Firefox:
Type Support for .vue Imports in TS
TypeScript cannot handle type information for .vue imports by default, so we replace the tsc CLI with vue-tsc for type checking. In editors, we need Volar to make the TypeScript language service aware of .vue types.
Customize configuration
See Vite Configuration Reference.
Project Setup
npm install
Compile and Hot-Reload for Development
npm run dev
Type-Check, Compile and Minify for Production
npm run build
Lint with ESLint
npm run lint
项目目录结构
vue-ai-lhx/
├── .vscode/ # VS Code配置文件
│ ├── extensions.json # 推荐扩展配置
│ └── settings.json # 工作区设置
├── public/ # 静态资源目录
│ └── favicon.ico # 网站图标
├── src/ # 源代码目录
│ ├── router/ # 路由配置
│ │ └── index.ts # 路由定义
│ ├── stores/ # 状态管理
│ │ └── counter.ts # 计数器状态示例
│ ├── App.vue # 根组件
│ └── main.ts # 应用入口文件
├── .editorconfig # 编辑器配置
├── .gitattributes # Git属性配置
├── .gitignore # Git忽略文件配置
├── .prettierrc.json # Prettier代码格式化配置
├── README.md # 项目说明文档
├── env.d.ts # 环境变量类型定义
├── eslint.config.ts # ESLint配置
├── index.html # HTML模板
├── package-lock.json # 依赖版本锁定文件
├── package.json # 项目依赖配置
├── tsconfig.app.json # TypeScript应用配置
├── tsconfig.json # TypeScript根配置
├── tsconfig.node.json # TypeScript Node配置
└── vite.config.ts # Vite构建配置
目录说明
- .vscode/: 包含VS Code的推荐扩展和工作区设置,确保团队开发环境一致。
- public/: 存放静态资源文件,如网站图标等,这些文件会被直接复制到构建输出目录。
- src/: 应用源代码的主要目录:
- router/: 定义应用的路由配置,控制页面导航。
- stores/: 使用Pinia进行状态管理,存放应用的全局状态。
- App.vue: 应用的根组件,所有其他组件都作为其子组件。
- main.ts: 应用的入口文件,初始化Vue应用、注册插件和挂载根组件。
- 配置文件: 包含项目构建、代码质量和开发环境的各种配置,确保项目的一致性和可维护性。
Introduction
可快速搭建基于 Vue 3 和 Vite 的前端开发环境,包含路由配置、Pinia 状态管理、TypeScript 支持及规范的目录结构,助力高效开发与团队协作。【此简介由AI生成】
https://gitcode.com/Lgg_lhx/vue-ai-lhxCustomize your domain