VScode中配置快捷代码片段

220 阅读1分钟

配置位置

image.png

配置代码片段

{
    "function": {
		"prefix": "df",
		"body": [
			"($1) => {",
			"  //函数体",
			"}"
		]
	},
    "map": {
		"prefix": "dmap",
		"body": [
			"$1.map((item, index) => {",
			"  $2",
			"  return $3",
			"})"
		]
	},
	"vue3": {
		"prefix": "vue3",
		"body": [
			"<template>",
			"",
			"</template>",
			"<script lang='ts' setup name=''>",
			"",
			"</script>",
			"<style scoped>",
			"",
			"</style>"
		]
	}

}