Vue file saving format in Vscode, ElementUI, Font Awesome two big plug-ins use

How to create a vue project

Method 1. Enter in the command prompt: vue create project name
insert image description here
Create through the command line
Method 2. Enter in the command prompt: vue ui
insert image description here
Enter http://localhost:8000 in the browser
insert image description here
to create through the graphical interface

The Vue file in Vscode is always red and has a format error? ? How to run someone else's project (without node_modules file)? ? Choose components and icons? ?

solve problem one

The prerequisites are: Prettier ESLint plug-in, ESLint plug-in ==
1. Open the settings to set
insert image description here
2. Find the text for editing, open the settings.json text in it
insert image description here
and add the content inside

"tabSize", "editor.codeActionsOnSave": { "source.fixAll.eslint": true }, "vetur.format.defaultFormatterOptions": { "prettier": { "singleQuote": true, "semi": false, "trailingComma ": "none" } } The final text content is (my example)









insert image description here

Solve problem two

The node_modules file saves some plug-ins or dependencies downloaded by the project, which are often very large. However, there are records in package.json, so we only need to execute npm installthe command to generate the node_modules file.
Then in the terminal:
1. Start the API server service
cd server
node index.js
2. Start vue
npm run serve

Solve problem three

Install ElementUI and Font Awesome plugins

npm install element-ui
npm install font-awesome

Global import (inside the mian.js file):

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import 'font-awesome/css/font-awesome.min.css'

The learning of these two components:
the official document of fontawesome icon library v4.7.0
fontawesome Chinese version, the new version v5.15.4 free version and professional version and the
official learning document of the old version v4.7 ElementUI

Guess you like

Origin blog.csdn.net/qq_46304554/article/details/129379744