安装VueCLI :
npm install -g @vue/cli
然后拉起CLI2 :方便可以创建CLI 2的项目:
npm install -g @vue/cli-init
1、 创建CL2 的项目
vue init webpack 项目名称
?Project name vuecli2 //项目名称
? Project description test vue cli2 //项目说明
? Author Ts //作者
? 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
? Vue build runtime
? Install vue-router? No //是否配置路由
? Use ESLint to lint your code? No //是否代码规范
? 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)
npm //使用npm
2 、创建Vue cli 3
vue create 项目名称