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
After the installation is completed, you can use the following command to verify whether the installation is successful. :
vue -V
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
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
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 配置文件
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!

ThinkPHP6脚手架使用指南:快速创建项目引言:ThinkPHP是一款广受欢迎的PHP开发框架,它提供了丰富的功能和便捷的开发方式,使得我们可以更加高效地创建和开发PHP项目。在最新的ThinkPHP6版本中,引入了脚手架工具,进一步简化了项目的创建和配置流程,本文将为大家介绍如何使用ThinkPHP6脚手架快速创建项目。I.安装ThinkPHP6脚手

Vue是一种流行的前端框架,它的灵活性和易用性受到了许多开发者的青睐。为了更好的开发Vue应用程序,Vue团队开发了一个强大的工具-Vue-cli,使得开发Vue应用程序变得更加容易。本文将为您详细介绍Vue-cli的使用方法。一、安装Vue-cli使用Vue-cli之前,需要先安装它。首先,您需要确保已经安装了Node.js。然后,使用npm安装Vue-c

Vue-cli脚手架工具使用及项目配置说明随着前端技术的不断发展,前端框架也越来越受到开发者的关注。Vue.js作为前端框架的佼佼者,已经被广泛应用于各种Web应用的开发中。Vue-cli是Vue.js官方提供的一个基于命令行的脚手架,可以帮助开发者快速初始化Vue.js项目结构,让我们能够更专注于业务开发。本文将介绍Vue-cli的安装和

Vue-cli3.0是一个基于Vue.js的全新脚手架工具,它可以帮助我们快速创建一个Vue项目并且提供了很多便捷的工具和配置。下面我们就来一步步介绍使用Vue-cli3.0创建项目的步骤和过程。安装Vue-cli3.0首先需要全局安装Vue-cli3.0,可以通过npm进行安装:npminstall-g@vue/cli安

Vue-cli是Vue.js官方提供的搭建Vue项目的脚手架工具,通过使用Vue-cli可以快速搭建Vue项目的基本骨架,便于开发人员将注意力集中在业务逻辑的实现上,而不用花费大量时间来配置项目的基础环境。本文将介绍Vue-cli的基本使用方法以及常用的插件推荐,旨在为初学者提供一份Vue-cli的使用指南。一、Vue-cli的基本使用方法安装Vue-cli

具体做法如下:1、创建后台服务器对象upstreammixVueServer{serverbaidu.com;#这里是自己服务器域名}2、创建访问端口和反向代理规则server{listen8082;server_namelocalhost;location/{rootE:/mix_vue/dist;#定位到项目的目录#indexindex.htmlindex.htm;try_files$uri$uri//index.html;#根据官网这规则配置}location~\.php${proxy_p

用到的技术:1、vue.js,vue-cli工程的核心,主要特点是双向数据绑定和组件系统;2、vue-router,路由框架;3、vuex,vue应用项目开发的状态管理器;4、axios,用于发起GET、或POST等http请求;5、vux,专为vue设计的移动端UI组件库;6、emit.js,用于vue事件机制的管理;7、webpack,模块加载和vue-cli工程打包器。

随着前端技术的不断发展,我们面临的问题也逐渐复杂了起来,不仅要求我们的代码结构合理、模块化设计良好,更需要代码的可维护性和执行效率。在这个过程中,如何保证代码的质量和规范性成为了一个难题。万幸的是,代码规范化和bug检测工具的出现,为我们提供了有效的解决方案。而在Vue.js框架中使用ESLint进行代码规范化和bug检测已成为一种普遍选择。一、ESLint


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

ZendStudio 13.5.1 Mac
Powerful PHP integrated development environment

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

Notepad++7.3.1
Easy-to-use and free code editor

VSCode Windows 64-bit Download
A free and powerful IDE editor launched by Microsoft

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.