.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 为所有文件默认格式化器
}
相关推荐
magic334165631 天前
ESP32S3开发环境介绍和创建工程
vscode·c·头文件
萌萌站起1 天前
Vscode 中 python模块的导入问题
ide·vscode·python
aqiu~1 天前
VSCode编辑器用于Unity项目
vscode·unity
王夏奇1 天前
pycharm中3种不同类型的python文件
ide·python·pycharm
ShawnLiaoking1 天前
pycharm 上传更新代码
ide·elasticsearch·pycharm
Freak嵌入式2 天前
MicroPython LVGL基础知识和概念:GUI 的扩展接口
ide·驱动开发·嵌入式·gui·lvgl·micropython·upypi
无限进步_2 天前
【C++】重载、重写和重定义的区别详解
c语言·开发语言·c++·ide·windows·git·github
ZXF_H2 天前
VSCode C/C++函数Ctrl+鼠标点击无法跳转的解决方法
c++·ide·vscode
这个人懒得名字都没写2 天前
PyCharm图像查看器插件PixelLens
ide·python·pycharm
zhangfeng11332 天前
vscode 之类的编辑器 ,跳转到某一个函数 方法 是什么快捷键 this->getEbayReturns($shop);
ide·vscode·编辑器