- ctrl+shift+P 打开设置
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/0c0ff5ef9102b9a24a9c66e146c33341.png)
- 输入snippets,选择配置用户代码片段[Snippets: Configure User Snippets]
- 输入JavaScript,选择JavaScript.json
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/26798bfc14460fdd5817d88b820aaf95.png)
- 把这段代码替换进去
"Print to jsNoteTitle": {
"prefix": "jsNoteTitle",
"body": [
"/*",
" *@description:",
" *@author: xxxx",
" *@date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
" *@version: V1.0.5",
"*/"
],
"description": ""
},
"Print to jsfn": {
"prefix": "jsfn",
"body": [
"/*",
" *@functionName: ${TM_CURRENT_LINE}",
" *@params1: ${1:参数1}",
" *@params2: ${2:参数2}",
" *@params3: ${3:参数3}",
" *@params4: ${4:参数4}",
" *@description:",
" *@author: albert",
" *@date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
" *@version: V1.0.5",
"*/"
],
"description": ""
},
"Print to jsModify": {
"prefix": "jsModify",
"body": [
"/*",
" *@description:",
" *@modifyContent:",
" *@author: xxxx",
" *@date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
"*/"
],
"description": ""
},
"Print to jsVariable": {
"prefix": "jsVariable",
"body": [
"/*",
" *@description:",
" *@author: albert",
" *@date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
" *@variable1: ${1:变量1}",
" *@variable2: ${2:变量2}",
" *@variable3: ${3:变量3}",
" *@variable4: ${4:变量4}",
" *@variable5: ${5:变量5}",
"*/"
],
"description": ""
}
- 使用,在js语句前打出JSNoteTitle
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/9657fcd5092b473a7c9dbff33c677967.png)
- 回车,就出现 如下
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/210d375612114a40120fe45a39e5266c.png)