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标签:Use,Vue,keys,生成,选择,arrow,脚手架,history From: https://www.cnblogs.com/Dollom/p/16856819.html