1、打开代码片段

2、搜索vue.json

3、添加代码片段(先ctrl+a,在ctrl+v),然后在自己整理格式
{ "Print to console": { "prefix": "vue", "body": [ "<template>", " <div class=\"\">\n", " </div>", "</template>\n", "<script>", "export default {", " props: {\n", " },", " data() {", " return {\n", " };", " },", " methods: {\n", " },", " created() {\n", " },", " computed: {\n", " },", " mounted() {\n", " },", " watch: {\n", " },", " components: {\n", " },", "};", "</script>\n", "<style scoped lang=\"${1:scss}\">\n", "</style>\n", ], "description": "Create vue template" } }
4、新建*.vue文件,输入vue,按tab即可(不要选择提示中的)
网友评论