一:项目搭建
使用create-vue脚手架创建项目
1.创建指令
pnpm create vue
# or
npm init vue@latest# or
yarn create vue
2.选择项目依赖内容
✔ Project name: … patients-h5-100
✔ Add TypeScript? … No / `Yes`
✔ Add JSX Support? … `No` / Yes
✔ Add Vue Router for Single Page Application development? … No / `Yes`
✔ Add Pinia for state management? … No / `Yes`
✔ Add Vitest for Unit Testing? … `No` / Yes
✔ Add Cypress for both Unit and End-to-End testing? … `No` / Yes
✔ Add ESLint for code quality? … No / `Yes`
✔ Add Prettier for code formatting? … No / `Yes`
Scaffolding project in /Users/zhousg/Desktop/patient-h5-100...Done. Now run:
cd patient-h5-100
pnpm install
pnpm lint
pnpm dev
3.下载运行第三方包
pnpm i
pnpm dev
项目开发需要的插件
必装:
Vue Language Features(Volar) vue3语法支持
TypeScript Vue Plugin (Volar) vue3中更好的ts提示
Eslint (如果安装了Prettier先禁用,避免冲突
eslint 预制配置:
1.eslintrc文件中添加如下配置:
rules: {
'prettier/prettier': [
'warn',
{
singleQuote: true,
semi: false,
printWidth: 100,
trailingComma: