vscode prettier怎么用?vscode中prettier插件怎么用
时间:2022-10-08 10:43:29
vscode中prettier插件怎么用?prettier插件是vscode中常用的插件之一,但是很多小伙伴不知道prettier插件怎么使用,下面小编就给大家带来Vscode中prettier插件使用方法,一起来看下具体的使用教程吧。
Vscode中prettier插件怎么使用?
1、首先打开Vscode,如果没有安装prettier插件,请先安装,安装方法是点击“Extension”图标,然后搜索 “prettier”,找到官方插件并安装;
2、然后准备一段示例代码,如下图是一段格式比较混乱的html代码;
3、在打开示例代码的vscode窗口中,使用快捷键“CTRL + Shift + P”打开vscode命令框,在框中输入“format”关键字,可以看到有2个选项:
1. Format Document (快捷键 Shift+Alt+F)对整个文档做格式化
2. Format Selection (快捷键Ctrl+K, Ctrl+F)对选择代码做格式化
可以根据需要选择其中一个选项
4、接着我们选择“Format Document”后,可以看到代码发生了变化,示例代码变得美观整洁,如下图所示:
5、最后,我们还可以选中部分代码,然后点击右键,在右键菜单中也会有2个选项,同样可以对现有代码做格式化,用起来很方便。
1. Format Document (Shift+Alt+F)
2. Format Selection (Ctrl+K, Ctrl+F)
标签:vscode,prettier怎么用,vscode中prettier怎么用,vscode,prettier插件,vscode
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
exce表格中怎么制作中国地图背景数据气泡图?
2022-07-23 01:15:37
![](https://img.aspxhome.com/file/2023/4/40574_0s.png)
windows7系统内存快速释放小技巧(不必重启电脑)
2023-05-28 05:46:34
![](https://img.aspxhome.com/file/2023/29/a257600_0s.jpg)
wps如何制作标签页?
2023-03-11 03:08:26
![](https://img.aspxhome.com/file/2023/2/a169082_0s.jpg)
CDR软件怎么将图片放进图形框操作方法分享
2023-03-11 04:14:00
![](https://img.aspxhome.com/file/2023/7/a327528_0s.png)
excel如何自定义背景图案?excel背景设置方法图解
2022-12-05 22:58:19
![](https://img.aspxhome.com/file/2023/3/41543_0s.jpg)
Excel表格中使用单变量求解分析数据的方法
2023-04-11 22:15:15
wps中格式刷怎么用?
2023-09-24 13:34:24
苹果探索全新的全玻璃iMac,终于要上触摸屏了
2023-11-02 17:52:07
![](https://img.aspxhome.com/file/2023/6/a203506_0s.jpeg)
video live wellpaper free锁屏不显示怎么解决
2022-02-16 02:07:02
![](https://img.aspxhome.com/file/2023/3/a298071_0s.png)
Windows2000系统 XP系统启动过程详解
2023-03-09 01:52:40
![](https://img.aspxhome.com/file/2023/27/a234520_0s.jpg)
如何利用“F4”与“$”高效运用Excel“绝对引用”
2022-08-18 01:24:29
![](https://img.aspxhome.com/file/2023/2/a161952_0s.jpg)
excel怎么计算相差日期天数
2023-11-27 14:12:53
如何重新启动MacBook Pro?
2023-06-29 18:29:09
![](https://img.aspxhome.com/file/2023/3/a207483_0s.jpeg)
升级win8.1 64位系统后无法玩剑灵怎么办?win8.1系统无法玩剑灵的解决方法
2023-03-19 12:57:07
![](https://img.aspxhome.com/file/2023/28/a245371_0s.jpg)
directx怎么安装_directx工具安装教程
2023-08-15 23:07:43
![](https://img.aspxhome.com/file/2023/4/a305826_0s.jpg)
office 2013 ppt 图片去除背景方法图解
2022-03-20 15:44:53
![](https://img.aspxhome.com/file/2023/10/a347362_0s.png)
笔者分享WPS常见问题汇总
2022-05-05 07:01:51
![](https://img.aspxhome.com/file/2023/7/a171197_0s.jpg)
Excel2010冻结窗口图文教程
2023-07-14 21:16:48
UC浏览器中如何使用鼠标手势?UC浏览器中使用鼠标手势的方法教程
2023-10-08 02:48:03
![](https://img.aspxhome.com/file/2023/7/a332747_0s.jpg)
怎么用U盘重装系统?Dell戴尔笔记本重装Win8系统
2022-09-03 11:55:39
![](https://img.aspxhome.com/file/2023/4/a307203_0s.jpg)