Now that you are here, you must know what vue is, and I won't go into details.
Not much nonsense.
Vue recommended development environment
Node.js 6.2.0、npm 3.8.9、webpack 1.13、vue-cli 2.5.1、webstrom2016
Now start installing the environment
Installing nodejs
can be downloaded in the terminal, but it is not recommended. The npm version will report an error
and go to the nodejs official website to download, address: http://nodejs.cn/Chinese website
Install vue Taobao mirror
npm install -g vue --registry= https://registry.npm.taobao.org
install webpack
npm install webpack -g
Install vue scaffolding
npm install vue-cli -g
—————— If you write a new vue project for the second time, you can start here ——————
Create a project based on the template
vue init webpack project name <project name cannot be in Chinese>
会有一些初始化的设置,如下输入:
Target directory exists. Continue? (Y/n) 直接回车默认(然后会下载 vue2.0模板,这里可能需要连代理)
Project name (vue-test) 直接回车默认
Project description (A Vue.js project) 直接回车默认
Author 直接回车默认
Use ESLint to lint your code? n
pick an eslint preset. 默认Standard
setup unit tests with karma + mocha?No(单元测试不需要)
setup e2e tests with Nightwatch?No(单元测试不需要)
进入项目
打开终端
cd 项目名字
安装项目依赖
npm install
安装 vue 路由模块vue-router和网络请求模块vue-resource –save-dev 是你开发时候依赖的东西,–save 是你发布之后还依赖的东西
npm install vue-router vue-resource –save
启动项目
npm run dev
发布项目
npm run build
目前基础搭建这里应该暂时可以了。