美文网首页
VScode为Vue文件设置模板代码

VScode为Vue文件设置模板代码

作者: 北冥有鱼_425c | 来源:发表于2020-01-12 22:34 被阅读0次
    1、安装插件:Vetur/vueHelper
    2、文件—》首选项—》用户代码片段

    ​ 添加如下代码:

    "vue": {
            "prefix": "vue",
            "body": [
                "<template>",
                "  <div>",
                "    ",
                "  </div>",
                "</template>",
                "",
                "<script>",
                "export default {",
                "  components: {},",
                "  data() {",
                "    return {",
                "      ",
                "    }",
                "  }",
                "}",
                "</script>",
                "",
                "<style lang='less' scoped>",
                "</style>",
            ],
            "description": "generate a vue file"
        }
    

    ​ 效果:

    <template>
      <div>
        
      </div>
    </template>
    
    <script>
    export default {
      components: {},
      data() {
        return {
          
        }
      }
    }
    </script>
    
    <style lang='less' scoped>
    </style>
    

    参考文档:https://blog.csdn.net/pengjunlee/article/details/97136104

    相关文章

      网友评论

          本文标题:VScode为Vue文件设置模板代码

          本文链接:https://www.haomeiwen.com/subject/qcwwactx.html