vscode 快速打出console.log()

1,370 阅读1分钟

1.code > 首选项 > 配置用户代码片段

image.png

2.输入javascript.json,并点击提示;

image.png

3.修改prefix为你喜欢的打出console.log()风格,我自己设置的是cls;

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

image.png

4.快速打出console.log();

image.png

  • 补充 body中1代表什么意思?输入cls后光标停留在1代表什么意思? 输入 cls 后光标停留在1的位置上;

  • 如何让输出的console.log后的括号中带引号? 把Print to console 的 body 中的 console.log(1)改为console.log(1) 改为 console.log('1')即可;