包含了最基础的Vue.js的框架,包含了打包工具和测试工具,开发调试的最基本的服务器,不需要关注细节,只需关注Vuejs对项目的实现
![](http://upload-images.jianshu.io/upload_images/5640239-7591e503272c8a47.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
npm在国内的网络使用较慢,所以推荐下载安装淘宝的镜像
![](http://upload-images.jianshu.io/upload_images/5640239-ddd27b002cf164b9.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1:
![](http://upload-images.jianshu.io/upload_images/5640239-d0a060f99504fb7d.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2:安装cnpm -v
![](http://upload-images.jianshu.io/upload_images/5640239-87532cbf72ac66d6.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
vue没有被找到
3:
![](http://upload-images.jianshu.io/upload_images/5640239-9733f64e8895c3b5.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
4:再次输入Vue的时候,我们会看到
![](http://upload-images.jianshu.io/upload_images/5640239-817acc1cdffbf385.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
接下来如何使用命令行工具?看官网
![](http://upload-images.jianshu.io/upload_images/5640239-353f213f3c9ea799.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
1: 我们在当前目录下生成一个
![](http://upload-images.jianshu.io/upload_images/5640239-b2ba4c87884e6260.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
以下信息可选填
![](http://upload-images.jianshu.io/upload_images/5640239-472c3d50aa8a963b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
2:项目初始化完成,我们发现目录下多了一项文件夹,大概长这个样子
![](http://upload-images.jianshu.io/upload_images/5640239-e720a7c8384ed832.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
![](http://upload-images.jianshu.io/upload_images/5640239-bac555c0be8bae16.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
不能直接看项目,项目不是独立存在 ,跟其他的库是有千丝万缕的联系的,所以要下载依赖包,可以直接在根目录下查看和安装,我们看一下
![](http://upload-images.jianshu.io/upload_images/5640239-e159f1a1fe1b4f5c.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
查看到信息和这套模板里面带的一些依赖
![](http://upload-images.jianshu.io/upload_images/5640239-919095fd8496640f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
这不是重要的,重要的是,cnpm install 这个命令,把所有的依赖都安装到当前的目录下
![](http://upload-images.jianshu.io/upload_images/5640239-46ac26c425d68afa.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
接下来使用命令行启动服务器 npm run dev
![](http://upload-images.jianshu.io/upload_images/5640239-2dbc0ed5f89bd577.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
监听的端口是8080
![](http://upload-images.jianshu.io/upload_images/5640239-f47dcf4dd4960402.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
搭建成功,在src文件夹底下进行剩下的开发
文末福利:
福利一:前端,Java,产品经理,微信小程序,Python等资源合集大放送:https://www.jianshu.com/p/e8197d4d9880
福利二:微信小程序入门与实战全套详细视频教程:https://www.jianshu.com/p/e8197d4d9880
领取方式:
如果需要学习视频,欢迎关注 【编程微刊】微信公众号,回复【领取资源】一键领取以下所有干货资源,获取更多有用技术干货、文档资料。所有文档会持续更新,欢迎关注一起成长!