.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 为所有文件默认格式化器
}
相关推荐
棒棒的唐7 小时前
Vscode Continue插件 集成 本地llama.cpp大模型实现代码补全
ide·vscode·编辑器
养肥胖虎8 小时前
多Agent开发笔记:为什么4个Codex加1个Claude会把cpu跑满
vscode·agent·codex
bush411 小时前
vscode编辑设备树插件 devicetree LSP
ide·vscode·里氏替换原则
摇滚侠12 小时前
IDEA 新建 JavaWeb 项目 Tomcat 和 Servlet
java·ide·intellij-idea
我先去打把游戏先13 小时前
VMware NAT 模式 Ubuntu 虚拟机「宿主机能上网、虚拟机 ping 不通外网 + apt 更新卡死」全故障复盘
linux·运维·vscode·单片机·嵌入式硬件·ubuntu·keil5
朝阳58115 小时前
VS Code 1.122 重磅登场:AI 全面自主,浏览器变身专业测试仪
人工智能·vscode
万粉变现经纪人15 小时前
2026最新Windows11系统CMD安装Claude Code 快速接入DeepSeek V4 Pro在VSCode编程工具中使用保姆级入门教程指南
linux·运维·ide·windows·vscode·macos·编辑器
兔老大RabbitMQ17 小时前
IDEA 打字打在光标右边 / 删除异常问题
java·ide·intellij-idea
码农小旋风18 小时前
Codex中文网 | Codex CLI 中文指南
运维·服务器·ide·人工智能·chatgpt·claude
问心无愧051318 小时前
ctf show web入门100
android·ide·笔记·android studio