1. 安装vue-cli:
npm install -g @vue/cli
vue -V
# 仍需要用vue-cli 2.x版本语法(vue init),需下载一个桥接工具:
npm install -g @vue/cli-init
2. 初始化webpack项目:
$ yarn global add @vue/cli-init
$ vue init webpack music
...
? Vue build (Use arrow keys)
Runtime + Compiler: recommended for most users
> Runtime-only: about 6KB lighter min+gzip, but templates (or any Vue-specific HTML) are ONLY allowed in .vue files -
render functions are required elsewhere
? Install vue-router? Yes
? Use ESLint to lint your code? Yes
? Pick an ESLint preset (Use arrow keys)
> Standard (https://github.com/standard/standard)
Airbnb (https://github.com/airbnb/javascript)
none (configure it yourself)
? Set up unit tests No
? Setup e2e tests with Nightwatch? No
? Should we run `npm install` for you after the project has been created? (recommended) yarn