Ctrl+Shift+p 搜
"代码片段(snipets)",新建一个应用于当前项目的代码版本,在文件中增加如下内容:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| { "vue3": { "prefix": "vue3", "scope": "vue", "body": [ "<template>", " <div>", "$1", " </div>", "</template>\n", "<script lang=\"ts\" setup>", "import { ref } from \"vue\" ", "$2", "</script>\n", "<style lang=\"scss\" scoped>", "$3", "</style>" ], "description": "vue3" } }
|
然后在 vue 文件中,输入 vue3
,按 tab
键就可以自动生成代码片段了。