VSCode代码模板-快速生成代码,使开发更高效

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VSCode代码模板-快速生成代码,使开发更高效相关的知识,希望对你有一定的参考价值。

参考技术A

  // Place your 全局 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and

  // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope

  // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is

  // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:

  // $1, $2 for tab stops, $0 for the final cursor position, and $1:label, $2:another for placeholders.

  // Placeholders with the same ids are connected.

  // Example:

  // "Print to console":

  //  "scope": "javascript,typescript",

  //  "prefix": "log",

  //  "body": [

  //    "console.log('$1');",

  //    "$2"

  //  ],

  //  "description": "Log output to console"

  //

  // Example:

  "Print to console":

    "prefix": "vue-tem",

    "body": [

      "<!-- 模块说明 -->",

      "<template>",

      "  <div class=\"container\">",

      "",

      "  </div>",

      "</template>",

      "",

      "<script>",

      "export default ",

      "  // 组件注册",

      "  components: ,",

      "  mixins: [],",

      "  props: [],",

      "  data () ",

      "    return ",

      "    ",

      "  ,",

      "  computed: ,",

      "  watch: ,",

      "  methods: ,",

      "  // 生命周期 - 创建完成(访问当前this实例)",

      "  created () ,",

      "  // 生命周期 - 挂载完成(访问DOM元素)",

      "  mounted () ,",

      "  destroyed () ",

      "",

      "</script>",

      "<style lang=\"scss\" scoped>",

      ".container ",

      "",

      "",

      "</style>",

      ""

    ],

    "description": "A vue file template"

 

以上是关于VSCode代码模板-快速生成代码,使开发更高效的主要内容,如果未能解决你的问题,请参考以下文章

前端开发工具vscode如何快速生成代码片段

vscode新建html文件并快速生成标准的html代码

vscode 快速生成html模板代码的几种方式

在vscode中快速生成vue模板

vscode怎么快速生成html框架

AngularDart 升级3.0,代码开发更高效