How to create a vue project
Method 1. Enter in the command prompt: vue create project name
Create through the command line
Method 2. Enter in the command prompt: vue ui
Enter http://localhost:8000 in the browser
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
2. Find the text for editing, open the settings.json text in it
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)
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 install
the 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