设置 ---> 代码片段
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选项式模板"
}
}