自学内容网 自学内容网

VSCode常用快捷键和功能

格式化代码:

Shift+Alt+F

JS中自动输入console.log()的方法:

先在vscode中,找到文件 > 首选项 > 配置用户代码片段,在弹出的下拉框处方输入javascript.json,复制下面的代码,覆盖原来的代码,保存即可。

{
// Place your snippets for javascript 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 String": {
"prefix": "csl",
"body": [
"console.log($1)",
"$2"
],
"description": "Log output to console"
},
"Print to console Var": {
"prefix": "csls",
"body": [
"console.log('$1')",
"$2"
],
"description": "Log output to console"
}
}


原文地址:https://blog.csdn.net/weixin_41422954/article/details/140252051

免责声明:本站文章内容转载自网络资源,如本站内容侵犯了原著者的合法权益,可联系本站删除。更多内容请关注自学内容网(zxcms.com)!