基于Vite+Vue3的项目模板,包含常用库
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
PeterAlbus 26ad734456 Update README.md. 2 years ago
.vscode Complete base template files 2 years ago
build/vite/plugins Complete base template files 2 years ago
public Complete base template files 2 years ago
src Update README.md. 2 years ago
.env.development Complete base template files 2 years ago
.env.production Complete base template files 2 years ago
.env.test Complete base template files 2 years ago
.eslintrc.cjs Complete base template files 2 years ago
.gitignore Complete base template files 2 years ago
LICENSE Initial commit 2 years ago
README.md Update README.md. 2 years ago
auto-imports.d.ts Complete base template files 2 years ago
components.d.ts Complete base template files 2 years ago
env.d.ts Complete base template files 2 years ago
index.html Complete base template files 2 years ago
package-lock.json Complete base template files 2 years ago
package.json Complete base template files 2 years ago
pnpm-lock.yaml Complete base template files 2 years ago
tsconfig.app.json Complete base template files 2 years ago
tsconfig.config.json Complete base template files 2 years ago
tsconfig.json Complete base template files 2 years ago
tsconfig.vitest.json Complete base template files 2 years ago
vite.config.ts Complete base template files 2 years ago

README.md

Vite + Vue3 + TypeScript

前端项目模板

This template should help get you started developing with Vue 3 in Vite.

该模板可以帮助快速构建一个基于Vite的Vue3项目。

Dependencies / 包含库

  • Vue3 + TypeScript + Less + Vue-Router + ESlint + Axios + Pinia
  • Element-Plus 2.2.15 + ElementPlus-Icons
  • OpenLayers 7 + ECharts 5.3.3 + turf
  • moment / nprogress / qs

Development Standard / 开发规范

  • 页面SFC存放于views文件夹内组件存放于components。
  • 接口url及请求相关方法放置于services文件夹内。不同环境通过VITE_APP_ENV识别。

IntelliJ IDEA / WebStorm

VSCode + Volar (and disable Vetur) + TypeScript Vue Plugin (Volar).

Type Support for .vue Imports in TS / .vue 文件的类型支持

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 TypeScript Vue Plugin (Volar) to make the TypeScript language service aware of .vue types.

If the standalone TypeScript plugin doesn't feel fast enough to you, Volar has also implemented a Take Over Mode that is more performant. You can enable it by the following steps:

  1. Disable the built-in TypeScript Extension
    1. Run Extensions: Show Built-in Extensions from VSCode's command palette
    2. Find TypeScript and JavaScript Language Features, right click and select Disable (Workspace)
  2. Reload the VSCode window by running Developer: Reload Window from the command palette.

Customize configuration / 自定义配置

See Vite Configuration Reference.

Project Setup / 安装依赖

npm install
or pnpm install

Compile and Hot-Reload for Development / 编译并启动热更新服务器

npm run dev
or pnpm run dev

Type-Check, Compile and Minify for Production / 类型检查并编译

npm run build
or pnpm run build

Run Unit Tests with Vitest / 单元测试

npm run test:unit
or pnpm run test:unit

Lint with ESLint / 使用ESLint

npm run lint
or pnpm run lint