Vue开发环境搭建

Vue
记录一下在mac环境下搭建Vue开发环境的一些步骤、问题和资料。

安装nodejs/npm

nodejs官网下载TSL版本的安装包
安装完成后,CMD下执行

1
2
node -v
npm -v

查看版本信息,如果可正常返回表示安装成功
参考网上资料

npmjs官网https://docs.npmjs.com/cli/install

npm换源http://www.jianshu.com/p/0deb70e6f395

1
npm install express --registry=https://registry.npm.taobao.org

由于国外网速较慢,建议切换到国内的源,比如淘宝源

淘宝npm源http://npm.taobao.org

1
npm install -g cnpm --registry=https://registry.npm.taobao.org

后面用cnpm替换npm

安装vue

1
npm install vue -g

安装vue-cli

1
npm install vue-cli -g

项目

初始化项目

1
vue init webpack project-name

安装编译/运行

1
2
3
cd project-name
npm install
npm run dev

其他准备工作

sublime

插件安装

javascriptNext ES6语法高亮
Vuejs Snippets vue语法提示
Vue highlight vue语法高亮
HTML/CSS/JS Prettify 这个插件就行, 安装后 tools->HTML/CSS/JS Prettify->set prettify preference 在”allowed_file_extensions”: [“htm”, “html”, “xhtml”, “shtml”, “xml”, “svg”,”vue”]

饿了么组件

项目模板

https://github.com/ElementUI/element-starter

参考资料

  1. Vue.js 快速入门 https://segmentfault.com/a/1190000003968020
  2. vuejs环境配置 http://www.jianshu.com/p/a8701d724e70
  3. vue awesome https://github.com/vuejs/awesome-vue#interactive-experiences
  4. 饿了么vue手机端ui框架mint-ui http://mint-ui.github.io/docs
  5. 饿了么vue组件库 http://element.eleme.io/#/zh-CN
  6. http://www.tuicool.com/articles/vyUzuiy
坚持原创技术分享,您的支持将鼓励我继续创作!