获得徽章 0
- 分享下我很喜欢的VScode下的代码片段
点击做左上角文件 => 首选项 => 用户片段,添加
{
"Print to console": {
"prefix": "csl",
"body": [
"console.log($1);"
],
"description": "Log output to console"
},
"Print to if": {
"prefix": "if",
"body": [
"if($1){}"
],
"description": "Log output to if"
},
"Print to for with length": {
"prefix": "forl",
"body": [
"for (let i = 0; i < $1.length; i++) {",
" ",
"}"
],
"description": "Log output to if"
},
"Print to Multi-line comments": {
"prefix": "///",
"body": [
"\/**",
" * $1",
" **\/"
],
"description": "Log output to console"
}
}
这样你想输入console.log()的时候,只需要输入csl后敲击Tab就可以快速输出你定义的模板代码啦展开124