.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 为所有文件默认格式化器
}
相关推荐
我是人✓1 小时前
IDEA(2017.3 x64)的安装及使用
java·ide·intellij-idea
Chase_______6 小时前
【Linux精讲|第1章】Vi 编辑器核心三模式——命令、插入、尾行全解析
linux·运维·编辑器
码踏樱花7 小时前
PyCharm专业版Win/mac/Linux 2017-2025多版本安装教程【长期使用】
ide·python·pycharm
拆房老料7 小时前
多人协同编辑Excel时,筛选相互干扰怎么办?Onlyoffice中国版给出了与WPS一样的答案
编辑器·excel·开源软件·wps
JavaPub-rodert7 小时前
VSCode 接入 Codex(基于 sub2api 的完整实战指南)
ide·vscode·编辑器·codex
守护安静星空8 小时前
ubuntu vscode 调试 at32f435vmt7
linux·vscode·ubuntu
2501_915921438 小时前
VSCode 写 Swift 运行到 iPhone?快蝎 IDE 开发实战体验
ide·vscode·ios·objective-c·个人开发·swift·敏捷流程
bkspiderx8 小时前
解决VS Code锁定编辑器组导致跳转定义/声明自动拆分编辑器问题
编辑器·vs code·锁定编辑器·跳转定义/声明自动拆分编辑器
BestOrNothing_20158 小时前
Ubuntu 22.04 下使用 VS Code 搭建 ROS 2 Humble 集成开发环境
c++·vscode·python·ros2·ubuntu22.04
果粒蹬i8 小时前
自建私有仪表盘:Dashlet 部署与公网访问全教程
人工智能·编辑器