Created in two ways vue entry 002 ~ vue project

Above one we have successfully installed nodejs, and equipped with npm global environment variable, then this section we take a formal installation vue-cli, then run our vue project developer tools in the webstorm.

In this section, there are two ways to create a project vue

  • 1, created via the command line npm
  • 2, by webstorm to create a key project

Ready to work

  • 1, before we create a project, you need to make sure nodejs has been successfully installed, if you have not installed npm global environment variable is not configured, you can refer to the  "Installation and Configuration nodeJs npm global environment variables"
  • 2, due to the three parties rely on the domestic installation with npm, slow, I suggest that you configured the domestic mirroring configuration as follows. Only need to perform the following operation can cmd in the command line window
npm config set registry https://registry.npm.taobao.org

First, create a project using the command line vue way

  • 1, the desktop create an empty folder, such as vue0117 image.png

    Into this folder, and then at the top of the address bar, type cmd, and then the Enter key to quickly open the dos command line and navigate to the current directory. image.png

  • 2, then execute the following command line installation vue-cli.

npm install -g vue-cli 

Wait for the installation image.png

Following completion of the installation, shown here vue-cli version number, which represents the completion of the installation image.png

  • 3, using a template to create a vue project webpack
vue init webpack my-project 

As project called vue001 image.png

At the following several interrogation item, according to the operation shown by the arrow directly to image.png

Download the required class library project image.png

After the project is created, as follows image.png

  • 4, cd vue001 into the project directory image.png

  • 5, the implementation of npm install the required library download download image.png

    Download completed image.png

  • 6, webstorm open project, click on the file, then click open image.png

Import vue project just created image.png

  • 7, run the project image.png

    image.png

    After the project is successful, open the following link in your browser image.png

    image.png

    Here successfully created and run on behalf of the project.

Second, the use webstorm a key project to create vue

  • 1, click on the file, then new, then click on the project image.png

  • 2, building project image.png

    image.png

  • 3, wait for the project to create and load the library image.png

    May be more time-consuming long, be patient. . . image.png

  • 3, above the building, you can browse and run the project image.png

    image.png

Here, two ways to create a way vue project are finished, I will be back to record a special video to explain. Stay tuned.

Published 164 original articles · won praise 349 · views 730 000 +

Guess you like

Origin blog.csdn.net/qiushi_1990/article/details/104017309