vscode写vue模板--代码片段

Ctrl+Shift+P打开命令输入 snippet (打开用户代码片段)
在输入vue(选择代码片段的语言)
如果搜索不到,安装一个插件 vueHelper
如果搜索到复制粘贴以下代码

{
    "Print to console": {
        "prefix": "vue",
        "body": [
            "<template>",
            " <div>
",
            " </div>",
            "</template>
",
            "<script>",
            " export default {",
            "   data () {",
            "     return {
",
            "     }",
            "   },",
            "   components: {
",
            "   }",
            " }",
            "</script>
",
            "<style>
",
            " ",
            "</style>",
            "$2"
        ],
        "description": "Log output to console"
    }
}

新建.vue文件
输入vue

按tab即可创建vue模板

原文地址:https://www.cnblogs.com/wenqiangit/p/10027839.html