How to use vue-cli (Vue scaffolding)

vue-cli is Vue quickly build single-page application scaffolding official produced, equivalent to React official produced the Create-REACT-App  , following the presentation vue-cli the most basic usage: 

 

1. Global Installation VUE-CLI , as used herein,  cnpm  installed, not installed cnpm but see: here

$ cnpm install -g vue-cli

 

2. After installation, we use the following command to initialize a vue project, during the execution of all press Enter

$ vue init webpack my-project

If you do not webpack installed, you can use cnpm installation 

 

3.  When finished, according to the command line prompt, we need to cut ./my-project directory, then load dependencies: CNPM install

$ cd ./my-project
$ cnpm install

Note the use of npm install is possible, but will be very slow, it is recommended to use cnpm

 

4. Run cnpm run dev startup project, appeared the following instructions, said that it has started successfully.

$ cnpm run dev

 

5. Open a browser, enter  localhost: 8080 to see the project start

 

Guess you like

Origin www.cnblogs.com/aisowe/p/11419072.html