Vue 0-1 build project

Vue builds a project from 0-1
Prerequisite: Enter the folder where the project needs to be created, open the command line window
windows+r open the command line window
to create a vue2.0 project:
automatic creation
1. vue create 项目名称
Only contains 3 functions: vue2/3, babel, eslint
insert image description here
manual creation
1. vue create 项目名称
Benefits: You can choose more functions
After entering the command, the following page appears:
insert image description here
2.
Configuration item
↑↓ switch option,
space switch selected state
* indicates the function to be installed
insert image description here
Select whether vue2.0 version
insert image description here
uses history mode Route (recommended to enter n)
insert image description here
Select the CSS preprocessor to use (I choose Less here)
insert image description here
Select the ESLint syntax rules to use (I choose ESLint + Standard config here)
insert image description here
Select additional lint functions (It is recommended to choose Lint on save, check whether the code conforms to the specification at the time of Ctrl + S)
insert image description here
which configuration file to put the configuration options of the third-party plug-in in (it is recommended to select In dedicated config files, which means: independent configuration file)
insert image description here
whether to save all the operations just now For the preset, it is convenient to generate the project directly based on the preset next time: n (as you use it)
insert image description here
Create a vue3.0 project:
use vite to build the project
1. Create a project

# 使用npm
npm create vite@latest
# 使用yarn
yarn create vite
# 使用pnpm
pnpm create vite

2. Enter the project name, the default is vite-project
insert image description here
3. Select the front-end framework
insert image description here

4. Select the project type
insert image description here5. Successfully created.
insert image description here
The vue3 component code is somewhat different from that of vue2, and the syntax prompts and highlighting plug-ins used are also different. If you use vscode to write code, vue3 needs to switch to a plug-in. The
vetur plug-in needs to be disabled and the volar plug-in is installed.

Guess you like

Origin blog.csdn.net/weixin_45534301/article/details/131433986