Use Vue-cli to create a vue project (vue basics)

1. Enter the following command under CMD

vue create demo

2. Choose the configuration method

Insert picture description here
Description:

  • Default ([Vue 2] babel, eslint): Default configuration (vue2)
  • Default (Vue 3 Preview) ([Vue 3] babel, eslint): Default configuration (vue3)
  • Manually select features: manual default configuration
    here we choose Manually select features manual configuration

3. Manually select the package required by the project*

Insert picture description here
Description:

  • Choose Vue version : Choose Vue version
  • Babel : Compile Babel, compile ES6 into ES5, and be compatible
  • TypeScript : A language extension that adds features to Javascript
  • Progressive Web App (PWA) Support : Let web pages gradually become APPs
  • Router : Vue routing
  • Vuex : Vue state management
  • Css Pre-processors : CSS pre -processors (including: SCSS/Sass, Less, Stylus)
  • Linter/Formatter : Code detection and formatting
  • Unit Testing : unit testing
  • E2E Testing : End-to-end testing

Check according to your needs, use the arrow keys ↑↓ to select, press the space to select/cancel

4.vue version

Insert picture description here

Description:
Choose according to your own project needs

5. Whether the routing uses history mode, select Y
Insert picture description here

6. Choose css compilation method

Insert picture description here
Note:
Choose your own proficient compilation method, here I choose less

7. Choose a code specification

Insert picture description here
Description:

  • ESLint with error prevention only : only error notification
  • ESLint + Airbnb config : non-rigorous mode
  • ESLint + standard config : normal mode
  • ESLint + Prettier : strict mode

8. Choose the appropriate verification code specification

Insert picture description here

9. The configuration file is placed in a separate configuration file? Or put it in package.json?

Insert picture description here
Description:
Choose according to your own project needs

10. Whether to save the current preset, no need to configure again next time build

Insert picture description here
Note:
If you want to save the previous settings, you can select y, and then enter the name you want to save. You don’t need to configure it next time you create it. If you don’t want to save it, you can do it again by following the above steps.

Click here to learn about the directory created by vue → here for details, please click

This is the steps to create a vue project, if you want to learn more → https://cli.vuejs.org/zh/guide/

Guess you like

Origin blog.csdn.net/weixin_44637104/article/details/113727291