日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網站首頁 編程語言 正文

vscode快速輸出格式化console.log

作者:布偶亂跑 更新時間: 2022-04-10 編程語言

在前端開發中,經常使用打印,格式化打印能幫助快速找到和區分打印內容,方法如下

  1. 設置 - 用戶代碼片段 - 選擇javascript
  2. 復制
{
  // 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:
  "console===": {
    "prefix": "log",
    "body": ["console.log('$1===', $1)"]
  }
  // 	"description": "Log output to console"
  //
}
  1. 在設置中搜索snippetSuggestions,把第一項下拉的值改為top
  2. 在js或者vue中輸入log,第一項為自定義的代碼片段,tab補全直接輸入需要打印的內容
  3. 如:console.log('list===',list), 結果console.log('list===', [1,2,3])

原文鏈接:https://blog.csdn.net/weixin_44634372/article/details/112260918

欄目分類
最近更新