1、点击【文件】---【首选项】---【用户代码片段】

2、新建或修改vue.json

3、将下列代码粘贴上去(可根据自己需要添加/删除)
{ "Print to console": { "prefix": "vue", "body": [ "<template>", " <div>\n", " </div>", "</template>\n", "<script>", "export default {", " data() {", " return {\n", " };", " },", " created() {\n", " },", " mounted() {\n", " },", " methods: {\n", " }", "};", "</script>\n", "<style scoped lang=\"${1:less}\">\n", "</style>\n", ], "description": "Create vue template" } }
本文详细介绍如何在VSCode中配置Vue代码片段,通过简单几步即可快速创建Vue模板,提高前端开发效率。
2094





