01-自定义选择功能
空格键“选中”,回车下一页
————————————————
(*) Babel ---- JavaScript 编译器 (必选)
( ) TypeScript ----TypeScript 编写程序
( ) Progressive Web App (PWA) ----01 webapp支持 02 离线支持 我是新手 (不选)
>(*) Router ----vue的URL管理 早晚要用(选上)
(*) Vuex ----vue状态管理 早晚要用(选上)
(*) CSS Pre-processors ----css代码编译 如less、sass、sass等 用原生css (可不选)
(*) Linter / Formatter ----代码规范插件 (新手一定别选)
( ) Unit Testing ----前端单元测试 (不选)
( ) E2E Testing ----自动化测试 (不选)
02-选择vue使用版本
? Choose a version of Vue...
3.x
> 2.x
03-是不是用history模式来创建路由
默认:hash模式
最直观的区别:就是在url中 hash 带了一个很丑的 # 而history是没有#的
hash —— 即地址栏 URL 中的 # 符号(此 hash 不是密码学里的散列运算)。比如这个 URL:http://www.abc.com/#/hello hash 的值为 #/hello。
它的特点在于:hash 虽然出现在 URL 中,但不会被包括在 HTTP 请求中,对后端完全没有影响,因此改变 hash 不会重新加载页面。
history —— 利用了 HTML5 History Interface 中新增的 pushState() 和 replaceState() 方法。(需要特定浏览器支持)这两个方法应用于浏览器的历史记录栈,在当前已有的 back、forward、go 的基础之上,它们提供了对历史记录进行修改的功能。只是当它们执行修改时,虽然改变了当前的 URL,但浏览器不会立即向后端发送请求。
一般场景下,hash 和 history 都可以,除非你更在意颜值,# 符号夹杂在 URL 里看起来确实有些不太美丽。
转自介绍原文 https://www.jb51.net/article/144341.htm
Vue CLI v5.0.1
? Please pick a preset: Manually select features
? Check the features needed for your project: Babel, Router, Vuex, CSS Pre-processors
? Choose a version of Vue.js that you want to start the project with 2.x
? Use history mode for router? (Requires proper server setup for index fallback in production) (Y/n) no
04-选择css编译器类型(原生css没有这一步)
? Pick a CSS pre-processor (PostCSS, Autoprefixer and
CSS Modules are supported by default): (Use arrow keys)
> Sass/SCSS (with dart-sass) ----css编译
Less ----css编译
Stylus
05-配置文件是否单独存放
? Use history mode for router? (Requires proper server setup for index fallback in production) No
? Pick a CSS pre-processor (PostCSS, Autoprefixer and CSS Modules are supported by default): Sass/SCSS (with dart-sass)
? Where do you prefer placing config for Babel, ESLint, etc.? (Use arrow keys)
> In dedicated config files ----单独放一个文件夹 (选单独存放)
In package.json ----都放package.json
06-是否存储你刚才的配置为一个预设类型 (下次直接选就能用)
? Save this as a preset for future projects? (y/N)y
07-预设命名
? Save this as a preset for future projects? Yes
? Save preset as: mingming ----为你的预设起个名字
回车 就创建成功了