vscode写vue模板--代码片段

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

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

新建.vue文件
输入vue
按tab即可创建vue模板

猜你喜欢

转载自blog.csdn.net/zsytechnology/article/details/78304542