VsCode快速打出console.log()方法设置

一、背景

作为一名前端开发,console.log是一个使用频率极高的调试功能,接下来让我们看看如何快速的打出console.log()。

二、VsCode设置

1、找到文件 > 首选项 > 配置代码片段;
2、输入javascript.json,并点击提示;

先在弹出的输入框内填入javascript.json,选择提示进而跳转相应页面。

如果是用React框架,就选择javascriptreact.json进行配置,博主这里以javascriptreact.json举例,其他类似:

XML 复制代码
{
	// Place your snippets for javascriptreact here. Each snippet is defined under a snippet name and has a prefix, body and 
	// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
	// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
	// same ids are connected.
	// Example:
	"Print to console": {
		"prefix": "log",//这里配置快速打印console.log的字母,例如:输入log,实现手动console.log效果
		"body": [
			"console.log('$1');",
			"$2"
		],
		"description": "Log output to console"
	}
}
3.修改prefix为你喜欢的打出console.log()风格,我自己设置的是log;

如果你的Print to console被注释了,直接解除注释,修改prefix中的值为你喜欢的console.log风格即可。(记得保存哟)

相关推荐
NQBJT3 小时前
VS Code配置Python人工智能开发环境
开发语言·人工智能·vscode·python
π同学5 小时前
ESP-IDF+vscode开发ESP32第十讲——I2S工程2
vscode·esp32·sd·音频播放
望眼欲穿的程序猿5 小时前
苹果系统使用VsCode开发QT
ide·vscode·编辑器
其实防守也摸鱼7 小时前
带你了解与配置phpmyadmin
笔记·安全·网络安全·pdf·编辑器·工具·调试
IOT那些事儿7 小时前
Qt5 VSCode调试
c++·vscode·mingw·qt5
SilentSamsara8 小时前
标准库精讲:collections/itertools/functools/pathlib 实战
开发语言·vscode·python·青少年编程·pycharm
Rsun045518 小时前
Oracle中常用语法
编辑器
2501_9151063211 小时前
在Mac上搭建iOS开发环境的详细步骤与注意事项
ide·vscode·macos·ios·个人开发·swift·敏捷流程
鸿_H11 小时前
杂记11---ubuntu2204环境vscode/cursor切换中文输入法
vscode·cursor·ubuntu2204
SilentSamsara11 小时前
Python 并发基础:threading/GIL 与 multiprocessing 的选型逻辑
服务器·开发语言·数据库·vscode·python·pycharm