vscode 快捷键 自定义注释
vscode 快捷键 自定义注释 自定义代码等
·
{
// 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": {
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"Print to js method": {
"prefix": "zhushi",
"body": [
"/**",
" * @Description: $0",
" * @MethodAuthor: Liszter",
" * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
"*/"
],
},
}
主要是配置这个文件。
具体过程:
- ctrl+shift+p 打开
2. 输入 snippets
3.选择配置类型,各种语言都可以设置
按照例子搞就行了。。。。
基础版本的:
{
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"Print to js method": {
"prefix": "zhushi",
"body": [
"/**",
" * @Description: $0",
" * @MethodAuthor: Liszter",
" * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
"*/"
],
},
"Print to slot": {
"prefix": "zujian",
"body": [
"/**",
" * @Description: $0",
" * ",
" * 参数:(参数名 描述 类型 默认值)",
" * ",
" * 事件:",
" * ",
" * 插槽: ",
" * ",
" * ",
" * @MethodAuthor: Liszter",
" * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
"*/"
],
},
"Print to zhushi": {
"prefix": "author",
"body": [
"/**",
" * ",
" * ",
" * ",
" * @MethodAuthor: Liszter",
" * @Date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
"*/"
],
},
}
更多推荐
已为社区贡献2条内容
所有评论(0)