使用 vue-cli 创建 vue3 项目

全局安装 vue-cli:

npm install -g @vue/cli

查看 vue-cli 版本:

vue -V

升级 vue-cli 版本:

npm update -g @vue/cli

使用指定版本的 vue-cli,先删除之前版本再重新安装:

npm uninstall -g @vue/cli
npm install -g @vue/cli@3.4.1

创建项目:

vue create vue-admin项目名


> Manually select features 手动选择配置


 (*) Babel
 ( ) TypeScript
 ( ) Progressive Web App (PWA) Support
 (*) Router
 (*) Vuex
 (*) CSS Pre-processors
 (*) Linter / Formatter
 ( ) Unit Testing
 ( ) E2E Testing
 
 
? Choose a version of Vue.js that you want to start the project with (Use arrow keys)
> 3.x


Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) n 不使用 history 模式路由


? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default):
> Sass/SCSS (with dart-sass)


? Pick a linter / formatter config:
  ESLint with error prevention only
  ESLint + Airbnb config
> ESLint + Standard config
  ESLint + Prettier


? Pick additional lint features: (Press <space> to select, <a> to toggle all, <i> to invert selection, and <enter> to
proceed)
 (*) Lint on save
 (*) Lint and fix on commit 保存和提交时都 lint
 

? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
> In dedicated config files 单独配置文件


? Save this as a preset for future projects? (y/N) N 

启动项目:

cd vue-admin项目名
npm run serve
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值