Several ways to create a vue project

I have been learning vuejs, element-ui, iview-ui and other front-end knowledge recently, and found that there are several different methods when creating a vuejs project:

First, use vue-cli scaffolding to create a new vuejs project

Using vue-cli scaffolding can quickly build a front-end vue framework project structure

Prerequisites: The installed node can normally use the npm command, and the vue-cli tool is installed globally.

Nodejs can go to the nodejs official website to download the latest version, choose the appropriate version according to your operating system, and then install, configure the environment variables.

Install vue-cli scaffolding globally

npm install vue-cli -g

Start creating project

  • Use vue to initialize a new project based on webpack
vue init webpack my-project

During the project creation process, it will prompt whether to install eslint, you can choose not to install, otherwise there will be various code format problems during the project compilation process

  • After the project is created, install the basic module
cd myproject
npm install

The module installation time may be very long, depending on the network speed;

  • After the installation is complete, you can run the project in development mode and preview the project effect
npm run dev;
  • If the project can start normally, you can continue to install the auxiliary tools of vue
npm install vue-router --save (路由管理模块)
npm install vuex --save (状态管理模块)
npm install vue-resource --save (网路请求模块)

The following two methods are based on Vue Cli3,
Vue CLI3 requires Node.js 8.9 or higher

Second, use the vue create command to create a vue project

vue create hello-world
cd hello-world
npm run serve  // 运行  http://localhost:8000

Third, use the ui command of vue cli3 to create a vuejs project based on a graphical user interface

Enter the command vue ui in the command line window to create the vuejs project
vue ui // Automatically run the graphic page http: // localhost: 8000 For
details, please refer to the article Creating a vue project using a graphical interface , fool-style operation, based on the picture interface, It is convenient to create and install dependencies and plugins.

References

Published 131 original articles · Like 38 · Visit 990,000+

Guess you like

Origin blog.csdn.net/ccf19881030/article/details/105358242