基于vue-cli初始化vue2模板的项目

一、安装Node.js,如果已有则不必安装

二、初始化 vue-cli的核心步骤:

在终端中输入以下命令进行全局安装:

npm install -g @vue/cli

三、创建Vue项目

在你要创建项目的目录下打开终端输入vue create 【你的项目名称】

vue create vue-demo 

 自定义配置

选择需要的配置:  

  1. Manually select features
    • (*) Choose Vue version ==> vue版本
    • (*) Babel ==> 将高版本js转换成低版本js兼容处理
    • ( ) TypeScript
    • ( ) Progressive Web App (PWA) Support
    • (*) Router ==> 路由
    • (*) Vuex ==> vuex状态管理
    • (*) CSS Pre-processors ==>css预处理
    • (*) Linter / Formatter ==> eslint规范
    • ( ) Unit Testing
    • ( ) E2E Testing
  2. Choose a version of Vue.js that you want to start the project with (Use arrow keys) —语言版本选择
    • 2.x
    • 3.x
  3. Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) —是否使用history路由模式 ,选no
    • n
  4. Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): (Use arrow keys) —选css预处理语言
    • Sass/SCSS (with dart-sass)
    • Sass/SCSS (with node-sass)
    • Less
    • Stylus
  5. Pick a linter / formatter config: (Use arrow keys)
    • ESLint + Airbnb config
    • ESLint + Standard config —选eslint语法规范
    • ESLint + Prettier
  6. Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection)
    • (*) Lint on save —保存时进行eslint处理
    • ( ) Lint and fix on commit
  7. Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
    • In dedicated config files —配置文件单独放置
    • In package.json
  8. Save this as a preset for future projects? (y/N) —刚刚配置选择的不保存,选no
    • N

 

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值