In the previous article, we installed 1. Enter a directory and create a projectThe command to create a project is as follows: vue create <Project Name> //The file name does not support camel case (including uppercase letters) After entering the command, you will be asked to select a We can see that there are 3 options by default:
We choose the third custom configuration 2. Select the configuration item you needThen we will jump to the configuration items. My custom configuration is as follows: The specific explanation is as follows: ◉ Choose Vue version // Choose the version of Vue◉ Babel // Transcoder, which can convert ES6 code into ES5 code so that it can be executed in the existing environment. ◯ TypeScript // TypeScript is a superset of JavaScript (suffix .js) (suffix .ts) that includes and extends the syntax of JavaScript and needs to be compiled and output as JavaScript to run in the browser ◯ Progressive Web App (PWA) Support // Progressive Web Application ◉ Router // vue-router (vue routing) ◉ Vuex // vuex (vue's state management mode) ◉ CSS Pre-processors // CSS preprocessors (such as less, sass) ◉ Linter / Formatter // Code style checking and formatting (such as ESlint) ◯ Unit Testing ◯ E2E Testing After the configuration is selected, we press Enter to proceed to the next step 2.1 Choose Vue version Next we need to select the After making your selection, press Enter to continue. 2.2 Choose whether to use history router Then we will be asked whether to use 2.3 Choosing a CSS preprocessor The 2.4 Select Eslint code validation rules Then select the 2.5 Choose when to perform code rule checkingThen let you choose when to perform code rule detection: ( ) Lint on save // Check when saving ( ) Lint and fix on commit // Check when fixing and committing It is recommended to test after saving. By the time 2.6 Choose how to store the configuration Next, choose whether to store some configuration files in separate files or store them all in > In dedicated config files // Independent file placement In package.json // Put in package.json 2.7 Save the current configurationFinally, choose whether to save the configuration you just selected so that you don’t need to re-select them one by one when you create other projects next time. If we choose y here, we will be asked to enter the name of the saved configuration information.
Here is the configuration information we just set. If we want to delete the configuration, just delete the information in presets. 3. Project configuration diagramHere is a picture of all the options we just filled in. 4. Project creation completed Finally, the following 5. Enter npm run serve to start the projectAfter the project is created, the project directory is as follows: We go directly into After the startup is complete, the console will display the following screen If we click http://localhost:8080/, we will see the homepage on the web page. 6. Project structure analysis After we create the project, we must know the overall structure of the project and what each folder and file of the project does. Next, we will introduce the project structure configuration in detail: Project structure configuration: node_modules It contains various environment dependency packages required by the project public src The source code we wrote on the front end will be in this folder .browserslistrc This file is some configuration for the browser. The contents of the file are as follows > 1% last 2 versions not dead Generally no modification is required .eslintrc.js Code style detection. If we configure some code rules in it, when we write code and there is code that does not conform to the rules, an error will be reported during compilation .gitignore This file is used to ignore certain files when uploading using Dockerfile .DS_Store node_modules /dist # local env files .env.local .env.*.local # Log files npm-debug.log* yarn-debug.log* yarn-error.log* pnpm-debug.log* # Editor directories and files .idea .vscode *.suo *.ntvs* *.njsproj *.sln *.sw? If you upload the entire project to the git server, the files with the above suffixes will not be uploaded. bable.config.js The file that configures package.json The configuration of the entire project package is included here, including the startup project command, etc. This is the end of this article about You may also be interested in:
|
<<: How to deploy Oracle using Docker on Mac
rm Command The rm command is a command that most ...
Because what I wrote before was not detailed enou...
How to install flash in Linux 1. Visit the flash ...
How to install PHP7 on Linux? 1. Install dependen...
need After the user fills out the form and clicks...
This story starts with an unexpected discovery tod...
Because I wrote the word transition incorrectly i...
Verification environment: [root@~~/]# rpm -qa | g...
location matching order 1. "=" prefix i...
This article shares a small example of adding and...
Experimental environment: 1. Three CentOS 7 serve...
The operating environment of this tutorial: Windo...
introduce Setting up read-write separation for th...
CAST function In the previous article, we mention...
Redis is a distributed cache service. Caching is ...