# 全局安装 vue-cli
$ cnpminstall --global vue-cli
# 创建一个基于 webpack 模板的新项目
$ vueinit webpack my-project
# 这里需要进行一些配置,默认回车即可
(This will installVue 2.x version of the template.
For Vue 1.x use: vue init webpack#1.0 my-project)
? Projectname my-project
? Projectdescription A Vue.js project
? Authorrunoob <test@runoob.com>
? Vuebuild standalone
? UseESLint to lint your code? Yes
? Pick anESLint preset Standard
? Setupunit tests with Karma + Mocha? Yes
? Setupe2e tests with Nightwatch? Yes
vue-cli · Generated "my-project".
To get started:
cd my-project
npm install
npm run dev
Documentation can be found at https://vuejs-templates.github.io/webpack