https://github.com/wp993080086/vite-pc-template
一个开箱即用基于vue3和ts的PC项目模板。
https://github.com/wp993080086/vite-pc-template
axios element-plus nprogress pinia sass typescript vite vue vue-router
Last synced: 3 months ago
JSON representation
一个开箱即用基于vue3和ts的PC项目模板。
- Host: GitHub
- URL: https://github.com/wp993080086/vite-pc-template
- Owner: wp993080086
- Created: 2022-04-27T07:36:29.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-11-08T08:17:37.000Z (over 2 years ago)
- Last Synced: 2025-06-12T15:06:57.371Z (about 1 year ago)
- Topics: axios, element-plus, nprogress, pinia, sass, typescript, vite, vue, vue-router
- Language: TypeScript
- Homepage:
- Size: 631 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README









# ⚡️ 简介
一个开箱即用,基于 `vite 4` + `vue 3` + `typeScript 5` + `element Plus` + `pinia` + `vue-router 4` 的PC端项目模板。
# 🚀 开发
1. 安装
```
npm install
```
2. 运行
```
npm run serve
```
> 如果不需要使用jsx/tsx,请做如下操作。
- 删除`tsconfig.json`文件里的 `"plugins": [{"name": "typescript-plugin-css-modules"}]`
- 删除`vite.config.ts`文件里的 `requireModuleExtension: true`
> 否则,请在根目录创建.vscode文件夹,并创建settings.json文件,并写入如下代码
```
{
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
```
# 📦️ 多环境打包
- 测试环境打包
```
npm run build_test
```
- 生产环境打包
```
npm run build
```
# 🔧 代码检查修复
- 格式检查
```
npm run lint
```
- 自动修复
```
npm run lint-fix
```
# 📚 目录
```
│ .env.development
│ .env.production
│ .env.test
│ .eslintignore
│ .eslintrc.js
│ .gitignore
│ .lintstagedrc.json
│ .prettierignore
│ .prettierrc.js
│ favicon.ico
│ index.html
│ package-lock.json
│ package.json
│ README.md
│ tsconfig.json
│ vite.config.ts
├─.husky
│ │ pre-commit
│ │
│ └─
│ .gitignore
│ husky.sh
│
├─mock
├─public
│ favicon.ico
│
└─src
│ App.vue
│ main.ts
│
├─assets
│ ├─font
│ ├─icon
│ ├─images
│ │ 404.png
│ │ logo.png
│ │
│ └─styles
│ colors.css
│ reset.css
│
├─components
│ │ HelloWorld.vue
│ │
│ ├─dialog
│ └─svgIcon
├─constants
│ index.ts
│
├─layouts
│ ├─header
│ │ index.vue
│ │
│ └─menu
│ index.vue
│ menu-item.vue
│
├─pages
│ ├─base
│ │ │ not-found.vue
│ │ │
│ │ └─login
│ │ index.vue
│ │
│ └─home
│ index.vue
│
├─router
│ │ index.ts
│ │
│ └─routers
│ base.ts
│
├─servers
│ │ request.ts
│ │
│ └─api
│ ├─files
│ │ index.ts
│ │
│ └─login
│ index.ts
│
├─static
│ ├─audio
│ └─video
├─store
│ │ index.ts
│ │
│ └─modules
│ ├─menu
│ │ index.ts
│ │
│ └─user
│ index.ts
│
├─types
│ │ common.d.ts
│ │ declare.d.ts
│ │ shim.d.ts
│ │ source.d.ts
│ │
│ ├─servers
│ │ files.d.ts
│ │ login.d.ts
│ │
│ └─store
│ menu.d.ts
│ user.d.ts
│
└─utils
cookie.ts
index.ts
loading.ts
storage.ts
toast.ts
token.ts
```