美文网首页
在idea中使用脚手架搭建vue项目

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

作者: 小王的全栈开发 | 来源:发表于2021-03-09 15:10 被阅读0次

在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

相关文章

网友评论

      本文标题:在idea中使用脚手架搭建vue项目

      本文链接:https://www.haomeiwen.com/subject/vkpwqltx.html