美文网首页
vscode 用户代码片段的使用

vscode 用户代码片段的使用

作者: 长街漫步 | 来源:发表于2019-05-20 18:12 被阅读0次

文件 > 首选项 > 用户代码片段 选择 新建代码片段

快速输出 console.log()

GIF.gif
"Print to console": {
    "scope": "javascript,typescript",
    "prefix": "log",
    "body": [
        "console.log('$1');",
    ],
    "description": "console.log()"
}

新建 *.vue 文件 自动生成 模板

GIF2.gif
    "Print to console": {
        "scope": "vue",
        "prefix": "vue",
        "body": [
            "<template>",
            "  <div class='app'>$0</div>",
            "</template>",
            "",
            "<script>",
            "export default {",
      "  beforeRouteEnter(to, from, next) {",
      "    return next(vm => {});",
      "  },",
      "  name: 'app',",
      "  data() {",
      "    return {};",
      "  },",
            "}",
            "</script>",
      "<style scoped>",
      "",
            "</style>"
        ],
        "description": "create vue"
    }

相关文章

网友评论

      本文标题:vscode 用户代码片段的使用

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