03 vue.js2.5 - Vue-cli installation, project templates to create webpack

Installation Vue-cli

The first

Seemingly can not, then the second, but after reinstall the system, the second can not be used, with the first possible

# 全局安装vue -cli命令
npm install --global vue-cli

# 创建基于 webpack 模板的新项目,使用webpack的模板
# 首先进入 desktop,然后会在desktop目录下创建todolist的项目
vue init webpack my-project
# 或者创建一个简单的webpack项目
vue init webpack-simple demo

vue installation. . . .

The installation is complete:

 

# 安装依赖
cd my-project --进入文件目录
npm run dev

 

Project localhost: 8080 launched

 

The second

# Global installation   @vue/cli-service is a locally installed dependent on each project, through the  @vue/cli creation
npm install -g @vue/cli

 

# vue create my-project

 

 

 

 Contents Introduction

build: webpack profile

config: configuration files for the development environment and the online environment

Dependent on the project: node_modules

src: placing the source code

static: static resources

 - babelrc:. Babel compiler

 - editorconfig:. Browser Configuration

 - eslintignore:. Eslint of detection rules

 - eslintrc.js:. Eslint of detection rules

 -. Gitignore

 --.postcss.js

 --index.html: the entire page outermost entry file

 --package.json

 --package-lock.json

 --README.md

 

vue-cli provide a new single-file assembly syntax

.Vue a file which contains all the parts of vue

Scaffolding tool can be used ES6 grammar, syntax and then packaged into ES5

 

##首先进入安装目录

cd todolist
##重新启动项目
npm run dev
npm run start

 


 

Browse the official website:  https://cn.vuejs.org/   learning "Tutorial

 

Published 241 original articles · won praise 14 · views 50000 +

Guess you like

Origin blog.csdn.net/qq_29150765/article/details/81300595