新建Vue项目步骤

1 必须安装 node 和 git  (node安装长期维护版)

2 win+r 输入 cmd 回车

3 npm -v (npm是前端的包管理工具)
如果版本号是6以上的版本 需要降级到6 

4 npm install -g npm@6.14.15

5 安装cnpm 
npm install -g cnpm

6 安装vue脚手架  vue/cli
npm install -g @vue/cli@3.10.0

6 查看vue版本 
vue -V  (大写的V)

-------------------以上动作为基础安装,每台电脑只做一次即可-----------------------------

1 将目录切入到要创建项目的目录中

2 创建项目
vue create 自己起一个项目名称

3 创建的选项   
? Please pick a preset: (Use arrow keys)
  default (babel, eslint)
  > Manually select features 
选择初始要添加的依赖 选择 Manually select features 

? Check the features needed for your project:
 (*) Babel
 ( ) TypeScript
 ( ) Progressive Web App (PWA) Support
 (*) Router
 (*) Vuex
>(*) CSS Pre-processors
 (*) Linter / Formatter  该选项为格式语法检查,新手别加
 ( ) Unit Testing
 ( ) E2E Testing
用空格选择

? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) Y
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): (Use arrow keys)
  Sass/SCSS (with dart-sass)
  Sass/SCSS (with node-sass)
  > Less
  Stylus
选择Less
? Pick a linter / formatter config:
  ESLint with error prevention only
  ESLint + Airbnb config
> ESLint + Standard config
  ESLint + Prettier
选择 ESLint + Standard config
? Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection)
>(*) Lint on save
 ( ) Lint and fix on commit
? Where do you prefer placing config for Babel, PostCSS, ESLint, etc.? (Use arrow keys)
> In dedicated config files
  In package.json
选哪个都可以

? Save this as a preset for future projects? (y/N) N
? Pick the package manager to use when installing dependencies: (Use arrow keys)
  Use Yarn
  > Use NPM
选择NPM

4 安装依赖 
切入项目
cd 项目名称
vue add axios
安装 elementui
vue add element
? How do you want to import Element? (Use arrow keys)
> Fully import
  Import on demand

Do you wish to overwrite Element's SCSS variables? (y/N) N

? Choose the locale you want to load (Use arrow keys)
> zh-CN
  zh-TW
  af-ZA
  ar
  bg
  ca
  cs-CZ
(Move up and down to reveal more choices)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值