1- Scaffolding installation tools (global)
npm install -g @vue/cli
Copy the code
2- View the Vue CLI installation version
vue --version
Copy the code
3- Create a new project
Vue create Project nameCopy the code
4- Generate project content:
1.Public: public static resources that do not participate in compilation and packaging (required for public projects)2.SRC: Develop resource packages3..gitignore: Upload git, ignoring file configuration4.Babel.config. js Banel configuration file5.Package. json package configuration file6.Package-lock. json version locks the file7.App. Vue root component8.Main.js Entry js file9.Components folder10.Static assets required by the SRC /assets component are compiled and packaged11.SRC /router Indicates the routing folder12.SRC /views module folderCopy the code
- Single-file components: templates, styles, js in one file;
- The scaffold
.vue
The ending file is the component
4- Run the development environment
NPM run serve // Starts a development server (based on webpack-dev-server) with hot-module-replacement of modules out of the box. / / App running at: - Local: http://localhost:8080/ - Network: http://192.168.17.131:8080/Copy the code
5- Install the router
npm install vue-router
Copy the code