Vue learning – Vue-Cli to create a Vue project (19)
It means that there is only one HTML page in a web site, all functions and interactions are completed in this one and only page, and the complexity is extremely high
vue-cli is a standard tool for Vue.js development. It simplifies the process of programmers creating Vue projects based on webpack
Installation and use
vue-cli is a global package on npm, use the npm install command to installnpm install -g @vue/cli
Quickly generate an engineered vue based on vue-clivue create project name
As long as you check the version, it means it can be run
1. Run cmd in the directory where the project needs to be created, enter vue create project name
, and then select (Manually is recommended here, manually select the installation)
2. Confirm the added components, select the space, select all a, cancel i, here we recommend three functions: 1, 2, CSS
3. Select the version, we choose vue2 (beginner), Less (because only Less)
4. Select the configuration file and put it in a separate folder, package.json is only responsible for recording its own file information
5. Whether to choose to save the configuration of the currently created project (whether it is possible here, if yes, just name it)
Then vue-cli starts to create the project, after creation, we only need toFirst npm install
in the path and then execute npm run serve
to run the project
Read more here: Source link