-
依次点击:文件 -> 首选项 -> 用户代码片段
-
选择你要选择的文件类型


json示例
{
"Print to init vue template": {
"prefix": "vt",
"body": [
"<template>",
" <div>",
" $0",
" </div>",
"</template>",
"",
"<script>",
"export default {",
" name: '$0',",
" data () {",
" return {",
" }",
" },",
" methods: {",
" },",
" mounted() {",
" }",
"}",
"</script>",
"",
"<style lang='less' scoped>",
"",
"</style>",
""
],
"description": "template with vue"
}
}
{
"Print to console": {
"prefix": "log",
"body": [
"console.log('$1');",
"$2"
],
"description": "Log output to console"
},
"Print to import": {
"prefix": "import",
"body": [
"import $0 from '$0'",
],
"description": "import"
},
"Print to lss": {
"prefix": "lss",
"body": [
"import lss from '@/services/LocalStorageService'",
],
"description": "lss"
}
}
效果
