文件→首选项→配置用户代码片段→vue.json(vue)
vue3版
{
"vue3": {
"prefix": "vue3",
"body": [
"<template>",
" <div>",
"",
" </div>",
"</template>",
"",
"<script lang='ts' setup>",
"import { reactive, ref, onMounted } from 'vue';",
"",
"",
"",
"</script>",
"",
"<style lang='scss' scoped>",
"",
"</style>",
],
"description": ""
}
}
vue2版
{
"vue": {
"prefix": "vue",
"body": [
"<template>",
" <div>",
"",
" </div>",
"</template>",
"",
"<script>",
"",
"",
"export default {",
" name: '',",
" components: {},",
" data() {",
" return {",
" ",
" }",
" },",
" computed: {},",
" created() {},",
" mounted() {},",
" beforeDestroy() {},",
" destroyed() {},",
" methods: {",
" ",
" }",
"}",
"</script>",
"",
"<style lang=\"scss\" scoped>",
"@import \"@a/style/base_vars\";",
"",
"</style>",
],
"description": ""
}
}