vue安装
# 升级或安装 cnpm
npm install cnpm -g
# 最新稳定版
$ cnpm install vue
# 全局安装 vue-cli
$ cnpm install --global vue-cli
# 创建一个基于 webpack 模板的新项目
$ vue init webpack my_vue_project
# 这里需要进行一些配置,默认回车即可
This will install Vue 2.x version of the template.
For Vue 1.x use: vue init webpack#1.0 my-project
? Project name my-project
? Project description A Vue.js project
? Author runoob <test@runoob.com>
? Vue build standalone
? Use ESLint to lint your code? Yes
? Pick an ESLint preset Standard
? Setup unit tests with Karma + Mocha? Yes
? Setup e2e tests with Nightwatch? Yes
vue-cli · Generated "my-project".
To get started:
cd my-project
npm install
npm run dev --启动vue项目
Documentation can be found at https://vuejs-templates.github.io/webpack
PS:
npm install安装js包报错信息
npm ERR! chromedriver@2.46.0 install: `node install.js`
解决方法:
npm install chromedriver --chromedriver_cdnurl=
http://cdn.npm.taobao.org/dist/chromedriver
项目启动
cd my_vue_project
npm run dev