首先:打开vs code 界面左下角如下图所示
选中打开齿轮选择用户代码片段
第一次搜索vue.json文件可能显示的是vue,或者没有,你可以先在vs code中下载Vetur插件先
打开vue.json后,默认是如下图
"Vue": {
"prefix": "vue",
"body": [
"<template>",
" <div>\n",
" </div>",
"</template>",
"<script>",
"export default {",
" data() {",
" return {",
" }",
" },",
" created(){",
" },",
" computed:{",
" },",
" methods:{",
" },",
"}",
"</script>",
"<style>\n",
"</style>",
"$2"
]
}
保存即可