Before creating a vue project, make sure that the vue environment is installed on your computer. If it is not installed, click to jump to the vue environment installation organized by the blogger: http://www.not yet organized
If the vue environment is installed, look down
In order to avoid the possibility of creation failure due to insufficient permissions during the creation process, we use the command line opened as an administrator throughout the process
The first step, after opening the command line, first enter the directory where we want to create the project
g: Indicates switching to the G drive
cd git means to open the git folder under the current disk
You can enter the directory where you want to save the project according to the above two commands. Here I save it in the G:\Git folder
The second step is to create a project
Enter the command in the command line: vue init webpack test-vue-admin
test-vue-admin is the name of the project you want to create, which is customized by you
Note that the vue2.0 project uses this specified command, and other commands may cause you to create a vue2.0 project, and there will be some vue3.0 things in the project
For details on how to fill in or select each link, please forget to read
Confirm the name of the created project with you, just press Enter here
Here you are asked to fill in the project description, the default is fine, press Enter to enter the next step
Here you are asked to fill in the author of the project, the default is fine, press Enter to enter the next step
Here you can choose the structure of the project, you can use the up and down keys to select, the first one is the default, press Enter to enter the next step
Here to confirm with you whether to use the official routing vue-router of the vue project, y: install, n: do not follow, enter y and press Enter (required for vue projects)
Ask here whether to use ESLint to lint the code, we don't need to use it, enter n and press Enter
The following two are to confirm whether to install the two test units, we do not need to install, enter n and press Enter
Here we confirm with you whether to use npm to inject dependencies into the project, or to use yarn to inject dependencies into the project, here we press Enter to select the first one, and then we slowly wait for the completion of project dependency injection. (Because the node we downloaded when installing the vue environment carries npm, and yarn needs to be installed separately)
Waiting for the approximate appearance in the screenshot below means that the project has been created and dependencies have been injected.
The two yellow commands that appear in the above picture tell us to start the project, which means 1. Open my project (test-vue-admin) folder 2. Run the project
However, because the test-vue-admin project we created has not been updated in time in the command line, directly executing cd test-vue-admina will prompt that the path cannot be found, so we close the command line and enter the created project directory. Enter cmd in the screenshot below and press Enter to open the command line
Then execute the command npm run dev and wait
Go to the screenshot below and the project is running! Copy the path below directly, paste it into the browser and open it