打开vsc 然后在左下角有一个设置
2.点击用户代码片段
3.输入 vue.json回车
将此代码粘贴 (我的不一定都适合)
{
"vue2 template": {
"prefix": "v2",
"body": [
"<template>",
" <div>",
" $1",
" </div>",
"</template>",
"",
"<script>",
"export default {",
" data() {",
" return {",
" $2",
" };",
" },",
" methods: {},",
" computed: {},",
" components: {},",
" filters: {},",
" watch: {},",
" created() {},",
" mounted() {},",
"};",
"</script>",
"",
"<style lang=\"scss\" scoped>",
" $3",
"</style>"
],
"description": "vue2"
},
"vue3": {
"prefix": "v3",
"body": [
"<template>",
" $1",
"</template>",
"",
"<script setup>",
"import { ref, reactive } from \"vue\";",
"",
"</script>",
"",
"<style lang=\"${2:scss}\" ${3:scoped}></style>"
],
"description": "vue3"
},
"vue3 ts": {
"prefix": "v3-ts",
"body": [
"<template>",
" $1",
"</template>",
"",
"<script lang=\"ts\" setup>",
"import { ref, reactive } from \"vue\";",
"",
"</script>",
"",
"<style lang=\"${2:scss}\" ${3:scoped}></style>"
],
"description": "vue3 ts"
},
}