1. Set shortcut key comments in vscode
1. Open vscode and use the shortcut key: ctrl+shift+p. For Mac, the shortcut key is: command+shift+p.
Then enter snippets in the line
2. Select "New" and select the file type to be configured (take the vue type as an example). The name I created here is vue.json.
Then modify the content to
{
"Print to console": {
"prefix": "zxlComments",
"body": [
"/* ",
" * @description: ",
" * @Copyright by: xxxxxc有限公司",
" * @author: 作者 ",
" * @date: ${CURRENT_YEAR}-${CURRENT_MONTH}-${CURRENT_DATE} ${CURRENT_HOUR}:${CURRENT_MINUTE}:${CURRENT_SECOND}",
"*/"
],
"description": "在vue文件开头配置注释"
}
}
2. Set Vue3 shortcut key template
1. Open vscode and use the shortcut key: ctrl+shift+p. For Mac, the shortcut key is: command+shift+p.
Then enter snippets in the line
{
"Print to console": {
"prefix": "v3", //自定义触发指令,我这里设置输入v3按下回车即可快速生成模板
"body": [ //定义模板内容
"<template>",
" <div>",
"",
" </div>",
"</template>",
"",
"<script setup lang='ts'>",
"import { reactive, ref, onMounted, computed } from 'vue';",
"</script>",
"",
"<style lang='scss' scoped>",
"",
"</style>"
],
"description": "Log output to console"
}
}
3. uni-app quick annotation
Find tools/code block settings/javascript code blocks
Modify file:
{
"method-annotation": {
"prefix": "zxl",
"body": [
"/**",
" * @Description:",
" * @author: ZXL",
" * @param $1",
" * @return $2",
" * @createTime: $DATE_TIME",
" * @Copyright by XXXXX科技有限公司",
" */"
],
"triggerAssist": false,
"description": "file annotation"
}
}