当前位置:   article > 正文

vscode新建代码片段:vue3+ts文件模板_vs v3ts 代码片段

vs v3ts 代码片段

使用vue3时,volar并没有给默认的vue文件生成模板,只能在vscode新建:

  1. 设置-新建代码片段,输入vue,回车
  2. 复制如下内容,保存:
{
  // Place your snippets for vue here. Each snippet is defined under a snippet name and has a prefix, body and
  // description. 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.
  "vue3": {
    "prefix": "vue3",
    "body": [
      "<template>",
      "  <!-- vue3页面 -->",
      "  <div> </div>",
      "</template>\n",
      "<script lang='ts'>",
      "import { defineComponent, reactive } from 'vue'",
      "export default defineComponent({",
      "  name: 'App',",
      "  setup() {",
      "    return {}",
      "  }",
      "})",
      "</script>\n",
      "<style scoped>",
      "</style>"
    ]
  }
}

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/583956
推荐阅读
相关标签
  

闽ICP备14008679号