[Vue learning] to quickly build a project

  • Installation node.js

    Official website: https://nodejs.org/en/

  • Taobao NPM mirror (npm is outside the network, with domestic agents to download and install really fast)

    $ npm install -g cnpm --registry=https://registry.npm.taobao.org

  • Global installed vue-cli

    $ cnpm install --global vue-cli

  • Create a new project based on a template webpack

    $ vue init webpack my-project

  • After the output of the above command line commands, options appear initial projects, the simple translation is as follows, configured according to project requirements

? Project name my-project // Project name 
? Project description A Vue.js project // project description
? Author runoob // Author
? Vue build standalone // Project Name
? Use ESLint to lint your code? Yes // whether to use ES norms
? Pick an ESLint preset standard // ESLint preset selection criteria
? Setup unit tests with Karma + Mocha ? Yes // use Karma + Mocha setting unit testing
? Setup e2e tests with Nightwatch? Yes // set e2e night table test

After the project is created, the project file into the root folder terminal

Enter the following command

 

In addition to this method, you can also use the compiler to create a key project

For example: I am using a Webstorm

New Project, select Vue.js (to [email protected] for example), then select the project location , version , etc., all ready after clicking NEXT created.

 

Then also need to do some initial configuration, whether ESlint, whether to install the route, and so on ......

After entering the project complete

Finally, click on the terminal (Terminal) lower left corner, enter the installation initial reliance, and to start the project as above, will not repeat them!npm install

Input , run the project.npm run dev

 

 

 

 

Open your browser and enter the address of the project mount

 

 

test was successful!

Guess you like

Origin www.cnblogs.com/Raincost-Z/p/12129937.html