1.在 vscode 中找到如图设置->代码片段->vue.json
2.配置默认值
{
"vue3": {
"prefix": "vue3",
"body": [
"<template>",
" <div></div>",
"</template>",
"",
"<script setup lang='ts'>",
"import {ref,reactive} from 'vue'",
"",
"</script>",
"<style scoped>",
"",
"</style>"
],
"description": "vue3"
},
"vue2": {
"prefix": "vue2",
"body": [
"<template>",
" <div></div>",
"</template>",
"",
"<script>",
"",
"</script>",
"<style scoped>",
"",
"</style>"
],
"description": "vue2"
}
}