安装node.js

  • http://nodejs.cn/download/
  1. 在cmd中输入node -v 出现版本号
    安装vue脚手架

全局安装nrm

npm install nrm -g nrm use taobao

全局脚手架

npm i @vue/cli -g

创建项目

vue create 项目名

配置

  1. 选择预设
    Please pick a preset: (Use arrow keys) 使用键盘上下键选择 回车确定
    default (babel, eslint) 默认只安装babel和eslint
    Manually select features 手动选择
  2. 手动选择插件(1,4,5,6)
  • Check the features needed for your project: 空格选择,a全选,i反选 回车确定
  • Babel 将高级版本ES转换为浏览器识别的JS语法
  • TypeScript JS的超集,提供了JS面向对象支持
  • Progressive Web App (PWA) Support PWA使应用向原生APP
  • Router 路由、请求所对应的地址
  • Vuex 数据状态管理器、用于多页面传参
  • CSS Pre-processors CSS预处理,将高级CSS语法转换为浏览器识别CSS语法
  • Linter / Formatter 代码检查工具
  • Unit Testing 单元测试
  • E2E Testing 端端测试
  1. 选择路由模式
    Use history mode for router?
    History模式 yes
    Hash模式 no 路由的后方有#只刷新部分内容
  2. 选择CSS预处理
    Pick a CSS pre-processor
    Sass/SCSS (with dart-sass)
    Sass/SCSS (with node-sass)
    Less
    Stylus
  3. 选择插件的配置存放
    Where do you prefer placing config for Babel, ESLint, etc
    In dedicated config files 独立的配置文件
    In package.json 直接放在package.json中
  4. 是否保存预设
    Save this as a preset for future projects
    N不保存
    Y保存
  5. cd /项目名
  6. npm run serve
    安装vue脚手架

相关文章:

  • 2021-11-12
  • 2021-11-05
  • 2021-03-05
  • 2018-05-26
  • 2019-05-20
  • 2021-11-05
  • 2020-04-30
  • 2018-03-09
猜你喜欢
  • 2019-06-21
  • 2018-08-31
  • 2018-02-13
  • 2021-11-29
  • 2018-08-09
  • 2018-07-13
  • 2020-04-28
  • 2020-02-22
相关资源
相似解决方案