安装vue-cli脚手架构建工具

vue安装

1.vue安装:

$ cnpm install vue

2.安装vue-cli脚手架构建工具:

# 全局安装 vue-cli
$ cnpm install --global vue-cli

3.构建于webpack模板的一个新项目:

#my-project为自定义项目名
$ vue init webpack my-project

初始化一个项目,或使用
$ vue init webpack-simple my-project

4.init

复制代码
Project name (my-project) # 项目名称(我的项目)

Project description (A Vue.js project) # 项目描述一个Vue.js 项目

Author 作者(你的名字)

Install vue-router? (Y/n) # 是否安装Vue路由,也就是以后是spa(但页面应用需要的模块)

Use ESLint to lint your code? (Y/n) # 使用 ESLint 到你的代码? (Y [ yes ] / N [ no ])

Pick an ESLint preset (Use arrow keys) # 选择一个预置ESLint(使用箭头键)

Setup unit tests with Karma + Mocha? (Y/n) # 设置单元测Karma + Mocha? (Y/ N)

Setup e2e tests with Nightwatch? (Y/n) # 设置端到端测试,Nightwatch? (Y/ N)



复制代码
复制代码
复制代码

? Project name vue-demo

? Project description demo

? Author luoxiaowei <[email protected]>

? Vue build standalone

? Install vue-router? Yes

? Use ESLint to lint your code? Yes

? Pick an ESLint preset none

? Set up unit tests No

? Setup e2e tests with Nightwatch? No

? Should we run `npm install` for you after the project has been created? (recom

mended) npm

 

cd vue-demo

cnpm run dev 

猜你喜欢

转载自www.cnblogs.com/michell/p/10366092.html