在idea中使用脚手架搭建vue项目
新建工程:

使用脚手架搭建vue项目:
在项目的Termainl
窗口进行操作

-
确保已安装node.js(官网下载安装)
-
安装淘宝npm源
(命令:`npm i -g cnpm --registry=https://registry.npm.taobao.org`)
-
安装脚手架
npm i -g vue-cli 测试是否安装成功: vue -V
-
初始化包结构
vue init webpack demo ? Project name (demo)//输入项目名字,可以直接按回车 ? Project description (A Vue.js project)//输入项目介绍,可以直接按回车 ? Author (***)//作者 ? Install vue-router? (Y/n)//是否安装vue-router vue路由,安装,Y ? Use ESLint to lint your code? (Y/n)//是否使用代码规范,不使用,n ? Set up unit tests (Y/n)//是否安装测试单元,不安装,n ? Setup e2e tests with Nightwatch? (Y/n)//不安装 ? Should we run `npm install` for you after the project has been created? (recommended) (Use arrow keys) > Yes, use NPM Yes, use Yarn No, I will handle that myself //选择No # Project initialization finished! # ======================== To get started: cd demo npm install (or if using yarn: yarn) npm run dev //项目包创建成功

网友评论