.vscode 扩展配置

一、vue快捷键配置

在项目.vscode下新建vue3.0.code-snippets

每当输入vue3.0后自动生成代码片段

复制代码
{
  "Vue3.0快速生成模板": {
    "scope": "vue",
    "prefix": "Vue3.0",
    "body": [
      "<template>",
      "  <div>${1:test}</div>",
      "</template>",
      "",
      "<script lang=\"ts\">",
      "export default {",
      "  setup() {",
      "    return {};",
      "  },",
      "};",
      "</script>",
      "",
      "<style lang=\"scss\" scoped></style>",
      ""
    ],
    "description": "Vue3.0"
  }
}

vue3.2.code-snippets

复制代码
{
  "Vue3.2+快速生成模板": {
    "scope": "vue",
    "prefix": "Vue3.2+",
    "body": [
      "<script setup lang=\"ts\"></script>",
      "",
      "<template>",
      "  <div>${1:test}</div>",
      "</template>",
      "",
      "<style lang=\"scss\" scoped></style>",
      ""
    ],
    "description": "Vue3.2+"
  }
}

vue3.3.code-snippets

复制代码
{
  "Vue3.3+defineOptions快速生成模板": {
    "scope": "vue",
    "prefix": "Vue3.3+",
    "body": [
      "<script setup lang=\"ts\">",
      "defineOptions({",
      "  name: \"\",",
      "});",
      "</script>",
      "",
      "<template>",
      "  <div>${1:test}</div>",
      "</template>",
      "",
      "<style lang=\"scss\" scoped></style>",
      ""
    ],
    "description": "Vue3.3+defineOptions快速生成模板"
  }
}

二、自动调用.prettierrc格式化代码

settings.json

复制代码
{
  "editor.formatOnSave": true, // 保存格式化文件
  "editor.defaultFormatter": "esbenp.prettier-vscode" // 指定 prettier 为所有文件默认格式化器
}
相关推荐
Super 含14 分钟前
Android 包体积优化(一):APK 到底大在哪里?从 APK 结构到体积分析
android·ide·vscode
愚公搬代码26 分钟前
【愚公系列】《Web应用安全》005-Visual Studio Code编辑器的使用
前端·安全·编辑器
Promising_GEO2 小时前
新电脑科研环境配置指南:Miniforge + PyCharm + GitHub 从安装到可用
ide·python·pycharm·github·地理
舞动青春882 小时前
vscode copilot配置kimi k3
ide·vscode·copilot
爱上纯净的蓝天3 小时前
AtomCode 多语言开发支持:一个 AI IDE 搞定全栈开发
ide·多语言·全栈开发·atomcode
浔川python社15 小时前
浔川系列产品后台维护与漏洞修复公告
编辑器
小小啊python1 天前
IDEA中SpringBoot项目配置热部署
java·ide·intellij-idea·springboot·热部署
golang学习记1 天前
VS Code 2026年的正确的打开方式
vscode
烂蜻蜓2 天前
Node.js入门教程(二十三):全局对象
node.js·编辑器·vim
树码小子2 天前
Pycharm解释器配置问题解决
ide·python·pycharm