Vue脚手架生成一个新项目

Vue脚手架生成一个新项目

 

1.输入cmd打开当前目录,并输入指令

vue create 项目名称

 

2.选择自己配置的历史配置或使用新配置

  • Manually select features (即为新配置一个)

Vue CLI v5.0.8
? Please pick a preset: (Use arrow keys)
 Default ([Vue 3] babel, eslint)
 Default ([Vue 2] babel, eslint)
> Manually select features

 

3.选择预装的依赖 (展示使用vue2需要的依赖)

? Check the features needed for your project: (Press <space> to select, <a> to toggle all, <i> to invert selection, and
<enter> to proceed)
(*) Babel
( ) TypeScript
( ) Progressive Web App (PWA) Support
(*) Router
(*) Vuex
(*) CSS Pre-processors
( ) Linter / Formatter
( ) Unit Testing
> ( ) E2E Testing

 

4.选择vue的版本

? Choose a version of Vue.js that you want to start the project with (Use arrow keys)
  3.x
>  2.x

 

5.是否要以history模式

是否要以history模式 【如果安装了Router,会出现下面选择】

是否要以history模式,如果选择yes,后端还需要作操作。路径好看 http://localhost:8080/about 选择no,后端无须修改操作。路径不好看 http://localhost:8080/#/

? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n)  n

 

6.选择css预处理器

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

 

7.选择配置文件存放方式

babel,postcss,eslint这些配置文件放哪? 第一个是:放独立文件放置 第二个是:放package.json里 这里推荐放单独配置文件

? 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) n
 
posted @   Dollom  阅读(35)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· Docker 太简单,K8s 太复杂?w7panel 让容器管理更轻松!
点击右上角即可分享
微信分享提示