To create a simple Vue project, do the following:
- 1. Node. js and Git are installed by default.
- To check whether the Node is successfully installed, run the following command:
NPM -v // Returns the version number, indicating success.Copy the code
- Then, you are happy to follow these steps to complete your initial Vue project creation.
Install @ vue/cli
- Perform:
NPM install --global @vue/cli // this is global install ====== tip: If the network speed is not ideal, try using Taobao image: 1. Perform installation CNPM: NPM install - 2 g CNPM - registry=https://registry.npm.taobao.org. Use CNPM CNPM install XXX (command) 2. Change the dependency source to Taobao through command configuration. 1. Implementation: NPM config set registry https://registry.npm.taobao.org 2.. Validation: NPM config get registry / / return, https://registry.npm.taobao.org, is the mirror configured successfully.Copy the code
- Create a simple VUE framework
Vue create vue- //vue create XXX (project file /name)Copy the code
- Start the project and install the VUex and Router
1.cd xxx/
2.vue add vuex
3.vue add router
Copy the code
- Perform:
NPM run dev // Runs the projectCopy the code