一.code -- 首选项 -- 用户片段
二.cmd+p打开搜索面板搜索vue.json,点击打开
三. 最后全文复制就好啦! 戳这里
{
// 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"
// }
"Print vue model": {
"prefix": "vue",
"body": [
"<template>",
" <div>$1",
" </div>",
"</template>\n",
"<script>",
"export default {",
" name:'$TM_FILENAME_BASE',",
" data() {",
" return {\n",
" }",
" },",
" components: {",
" }",
"}",
"</script>\n",
"<style lang=\"scss\">",
"</style>",
"$2"
],
"description": "my vue model"
}
}
注:1.其中的$1, $2 是快速生成后光标位置,先位于$1,按下Tab键后位于$2
2.自动生成name的秘诀就在$TM_FILENAME_BASE,详戳这里。