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
On some websites, you can often see some pictures...
Nowadays, application development is basically se...
Table of contents 1. What is syntactic sugar? 2. ...
After installing the database, if you accidentall...
This article uses examples to illustrate the prin...
Preface The previous article introduced the insta...
The relevant person in charge of Baidu Input Metho...
1. Download MySQL 1. Log in to the official websi...
Disable right-click menu <body oncontextmenu=s...
1. Introduction to MariaDB and MySQL 1. Introduct...
Table of contents 1. Database Operation 1.1 Displ...
This axios package is used in the vue3 demo. For ...
Table of contents Dirty pages (memory pages) Why ...
Preface How to write efficient SQL statements is ...
This article will introduce how to use explain to...