Vue installation
vue-cli /webpack global installation
Global webpack:
npm install webpack -g
vue scaffolding vue-cli:
npm install vue-cli -g
Install the webpack version of the vue project
Open the command window in the specified directory (the command window that comes with the editor is also available)
vue init webpack myvuedemo
Project name (Enter default)
Project description (A Vue.js project) Enter by default (you can also enter your own description)
Author Enter the default (own name)
Vue build selects Runtime+Compiler by default
Install vue-router? Y Install
Use ESLint to lint your code? Y (recommended to use, maintain good coding standards)
pick an eslint preset. Default Standard
set up unit tests? n (unit test, not required)
setup e2e tests with Nightwatch? n (e2e test, not required)
Should we run npm install for you after the project has been created? (recom
mended) npm (选用 npm )
Installed
Directory Structure
Vue run
Run the command
cd myvuedemo
npm run dev
Run successfully
Page content
Vue build packaging
packaging command
npm run build
Packaged directory structure
To run the packaged project, you
need to open the service to run.
Use http-server to run (if http-server is not installed, use node to install http-server globally, npm install http-server -g)
cd dist
http-server
# Install Vue Cli
npm install -g @vue/cli
# Create a project
vue create hello-world
# After the creation is complete, you can open the graphical interface through commands, as shown in the figure below
ui view