VScode为Vue文件设置模板代码

2020-01-12  本文已影响0人  北冥有鱼_425c
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

上一篇下一篇

猜你喜欢

热点阅读