vue3创建项目配置注意实现

61 阅读1分钟

vue create 项目名称

? Please pick a preset: (Use arrow keys)
  default (babel, eslint)   // 默认选项 
  Manually select features  //  手动选择功能
? Please pick a preset: Manually select features
? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection)
>( ) Babel                              //  代码编译
 ( ) TypeScript                         //  ts
 ( ) Progressive Web App (PWA) Support  //  支持渐进式网页应用程序
 ( ) Router                             //  vue路由
 ( ) Vuex                               //  状态管理模式
 ( ) CSS Pre-processors                 //  css预处理
 ( ) Linter / Formatter                 //  代码风格、格式校验
 ( ) Unit Testing                       //  单元测试
 ( ) E2E Testing                        //  端对端测试
 
 一般项目开发只需要选择`Babel``Router``Vuex`就足够了
Use history mode for router? (Requires proper server setup for index fallback in production)
路由是否使用`history`模式?如果项目中存在要求就使用`history`(即:y),但是一般还是推荐大家使用`hash`模式,毕竟`history`模式需要依赖运维。
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): (Use arrow keys)
> Sass/SCSS (with dart-sass)
  Sass/SCSS (with node-sass)
  Less
  Stylus
? Pick a linter / formatter config: (Use arrow keys)
> ESLint with error prevention only     //  只进行报错提醒
  ESLint + Airbnb config                //  不严谨模式
  ESLint + Standard config              //  正常模式
  ESLint + Prettier                     //  严格模式
  TSLint (deprecated)                   //  TypeScript格式验证工具
? Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection)
>(*) Lint on save               // 保存时检测
 ( ) Lint and fix on commit     // 修复和提交时检测
//  npm
npm install --save axios
//  vue
vue add axios