vscode中设置vue代码片段

原文链接; https://www.cnblogs.com/susu-yee/p/11533546.html

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

 2、新建或修改vue.json

 3、将下列代码粘贴上去(可根据自己需要添加/删除)

复制代码
{
    "Print to console": {
        "prefix": "vue",
        "body": [
            "<template>",
            "    <div>
",
            "    </div>",
            "</template>
",
            "<script>",
            "export default {",
            "    data() {",
            "        return {
",
            "        };",
            "    },",
            "    created() {
",
            "    },",
            "    mounted() {
",
            "    },",
            "    methods: {
",
            "    }",
            "};",
            "</script>
",
            "<style scoped lang="${1:less}">
",
            "</style>
",
        ],
        "description": "Create vue template"
    }
}
复制代码
 
 
 
原文地址:https://www.cnblogs.com/fsg6/p/13222519.html