Table of Contents
Install Vue-cli 3.0
Create a Vue project
Run the project
Project directory structure
Configuration files
Summary
Home Web Front-end Vue.js Vue-cli3.0 scaffolding to create Vue project steps and process

Vue-cli3.0 scaffolding to create Vue project steps and process

Jun 09, 2023 pm 04:08 PM
vue-cli scaffold vue project.

Vue-cli 3.0 is a new scaffolding tool based on Vue.js. It can help us quickly create a Vue project and provides many convenient tools and configurations.

Now we will introduce step by step the steps and process of creating a project using Vue-cli 3.0.

Install Vue-cli 3.0

First you need to install Vue-cli 3.0 globally, which can be installed through npm:

npm install -g @vue/cli
Copy after login

After the installation is completed, you can use the following command to verify whether the installation is successful. :

vue -V
Copy after login

If the version number is output, the installation is successful.

Create a Vue project

Execute the following command in the command line to create a new project:

vue create my-project
Copy after login

where "my-project" is the project name, according to your needs to modify.

After executing this command, some project configuration options will appear, such as whether to use Babel, whether to use Vuex, whether to use ESlint, etc. You can choose according to your needs. If you are not sure, you can just press Enter and use the default options.

After the selection is completed, the project installation will be carried out, and it may take a certain amount of time to wait for the installation to be completed.

Run the project

After the project installation is completed, enter the project folder and use the following command to run:

cd my-project
npm run serve
Copy after login

This command will start a local server, which can be accessed through the browser http://localhost:8080 Check the project running effect.

Project directory structure

After using Vue-cli 3.0 to create the project, the directory structure of the project is as follows:

|--node_modules          // 存放项目运行所需的模块
|--public                // 存放静态资源文件
|  |--favicon.ico        // 网站图标
|  |--index.html         // 网站入口文件
|--src                   // 存放项目源码文件
|  |--assets             // 存放静态资源文件
|  |--components         // 存放组件文件
|  |--views              // 存放页面文件
|  |--App.vue            // 页面入口文件
|  |--main.js            // 项目入口文件
|--.gitignore            // Git 版本库忽略文件列表
|--babel.config.js       // Babel 配置文件
|--package.json          // 项目配置文件
|--README.md             // 项目说明文件
|--vue.config.js         // Vue 配置文件
Copy after login

Among them, the src directory is The source code file of the project, the public directory is the folder where static resources are stored. main.js is the entry file of the project, App.vue is the entry file of the page. Under the src directory, the assets directory stores static resource files, such as pictures, style sheets, etc. In the src directory, components stores component files, and the views directory stores page files.

Configuration files

During the project creation process, Vue-cli 3.0 also generated some default configuration files, which are all located in the root directory of the project. Among them, package.json is the project configuration file, which contains the declaration of dependencies, script commands and other information required by the project. babel.config.js contains Babel’s configuration information. vue.config.js Contains Vue configuration information.

Summary

Vue-cli 3.0 makes it more efficient and simpler for us to create, develop and maintain Vue projects by providing convenient tools and configurations. The above are the steps and process of creating a Vue project using Vue-cli 3.0. I hope it can be helpful to everyone.

The above is the detailed content of Vue-cli3.0 scaffolding to create Vue project steps and process. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
WWE 2K25: How To Unlock Everything In MyRise
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

ThinkPHP6 scaffolding usage guide: quickly create projects ThinkPHP6 scaffolding usage guide: quickly create projects Aug 12, 2023 am 10:00 AM

ThinkPHP6 Scaffolding Usage Guide: Quickly Create Projects Introduction: ThinkPHP is a popular PHP development framework. It provides rich functions and convenient development methods, allowing us to create and develop PHP projects more efficiently. In the latest ThinkPHP6 version, scaffolding tools have been introduced to further simplify the project creation and configuration process. This article will introduce how to use ThinkPHP6 scaffolding to quickly create projects. I. Install ThinkPHP6 script

The use of Vue-cli scaffolding and its plug-in recommendations The use of Vue-cli scaffolding and its plug-in recommendations Jun 09, 2023 pm 04:11 PM

Vue-cli is a scaffolding tool officially provided by Vue.js to build Vue projects. By using Vue-cli, you can quickly build the basic skeleton of a Vue project, allowing developers to focus on the implementation of business logic without spending a lot of time. To configure the basic environment of the project. This article will introduce the basic usage of Vue-cli and commonly used plug-in recommendations, aiming to provide a guide to the use of Vue-cli for beginners. 1. Basic usage of Vue-cli Install Vue-cli

A detailed guide to using Vue-cli in Vue A detailed guide to using Vue-cli in Vue Jun 26, 2023 am 08:03 AM

Vue is a popular front-end framework favored by many developers for its flexibility and ease of use. In order to better develop Vue applications, the Vue team has developed a powerful tool-Vue-cli, which makes it easier to develop Vue applications. This article will introduce you to the use of Vue-cli in detail. 1. Install Vue-cli Before using Vue-cli, you need to install it first. First, you need to make sure you have Node.js installed. Then, install Vue-c using npm

Vue-cli3.0 scaffolding to create Vue project steps and process Vue-cli3.0 scaffolding to create Vue project steps and process Jun 09, 2023 pm 04:08 PM

Vue-cli3.0 is a new scaffolding tool based on Vue.js. It can help us quickly create a Vue project and provides many convenient tools and configurations. Below we will introduce step by step the steps and process of creating a project using Vue-cli3.0. To install Vue-cli3.0, you first need to install Vue-cli3.0 globally. You can install it through npm: npminstall-g@vue/cli

Vue-cli scaffolding tool usage and project configuration instructions Vue-cli scaffolding tool usage and project configuration instructions Jun 09, 2023 pm 04:05 PM

Instructions for using Vue-cli scaffolding tools and project configuration. With the continuous development of front-end technology, front-end frameworks are attracting more and more attention from developers. As a leader in front-end frameworks, Vue.js has been widely used in the development of various web applications. Vue-cli is a command line-based scaffolding officially provided by Vue.js. It can help developers quickly initialize the Vue.js project structure, allowing us to focus more on business development. This article will introduce the installation and installation of Vue-cli

How to deploy nginx to access projects built by vue-cli How to deploy nginx to access projects built by vue-cli May 15, 2023 pm 10:25 PM

The specific method is as follows: 1. Create the backend server object upstreammixVueServer{serverbaidu.com;#This is your own server domain name} 2. Create the access port and reverse proxy rule server{listen8082;server_namelocalhost;location/{rootE:/mix_vue/dist;# Locate the directory of the project#indexindex.htmlindex.htm;try_files$uri$uri//index.html;#Configure according to the rules of the official website}location~\.php${proxy_p

What technologies are used to build vue-cli projects What technologies are used to build vue-cli projects Jul 25, 2022 pm 04:53 PM

Technologies used: 1. vue.js, the core of the vue-cli project, whose main features are two-way data binding and component systems; 2. vue-router, the routing framework; 3. vuex, the state manager for vue application project development ; 4. axios, used to initiate http requests such as GET or POST; 5. vux, a mobile UI component library specially designed for vue; 6. emit.js, used to manage the vue event mechanism; 7. webpack, module Load and vue-cli project packager.

Using ESLint in Vue-cli for code standardization and bug detection Using ESLint in Vue-cli for code standardization and bug detection Jun 09, 2023 pm 04:13 PM

With the continuous development of front-end technology, the problems we face have gradually become more complex, which not only requires our code to have a reasonable structure and good modular design, but also requires code maintainability and execution efficiency. In this process, how to ensure the quality and standardization of the code has become a difficult problem. Fortunately, the emergence of code standardization and bug detection tools provides us with effective solutions. Using ESLint for code standardization and bug detection in the Vue.js framework has become a common choice. 1. ESLint

See all articles