当前位置: 首页 > news >正文

viscode 自定义片段,快速生成自己的开发模板

设置 --->   代码片段

  2.选择新建全局代码片段文件

3.根据示例自定义配置代码片段

 4.示例:vue

prefix:内容--> 代表用于触发代码片段的内容

$1, $2 用于制表位,如 $1 代表生成后第一个输入的位置,$2代表第二个,不用自己移动鼠标

{// Place your snippets for vue 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"// }"vue-template": {
"prefix": "vue",
"body": [
"<template>",
"  <div class=\"$1\">",
"    $3",
"  </div>",
"</template>",
"",
"<script>",
"export default {",
"  name: '$2',",
"  data() {",
"    return {}",
"  }",
"}",
"</script>",
"",
"<style scoped>",
"",
"</style>",
""
],
"description": "Vue选项式模板"
}
}


http://www.mrgr.cn/news/7925.html

相关文章:

  • java 字符串判断非空工具类 不用依赖
  • vue+uniapp
  • 树莓派与STM32(RT1064)的串口通信实现
  • Android 12中读写SD卡,提示Operation not permitted问题处理
  • 职场人士必备!2024年流行思维导图软件
  • 二叉搜索树
  • 【C语言】常见文件操作
  • 后端Web之登录校验(下篇)
  • Jupyter Notebook 使用多个Kernel
  • 日常开发规范
  • C# 使用OpenCV 类VideoCapture 和 Mat的正确方法
  • 【五】阿伟开始学Kafka
  • docker系列12:Dockerfile实战
  • MAVEN 3.9.1安装
  • 机器人走路问题优化解法
  • 字符设备驱动程序 --使用GPIO控制引脚高低电平(点亮LED)
  • 事件监听查看、监听器删除方法
  • TCL提前批一面(安卓系统工程师)
  • 使用css如何获取最后一行的元素?使用css解决双边框问题
  • Win/Linux/Mac 安装Python 3.6