在idea中使用脚手架搭建vue项目

在idea中使用脚手架搭建vue项目

新建工程:

image-20210309160024621.png

使用脚手架搭建vue项目:

在项目的Termainl窗口进行操作

image-20210309161427258.png
  • 确保已安装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
    
    //项目包创建成功
    
image-20210309162927669.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容