插件主页:https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar

# Vue2支持

1.安装@vue/runtime-dom

yarn add @vue/runtime-dom
1

2.配置tsconfig.json

{
  "compilerOptions": {
    "allowJs": true,
    "baseUrl": ".",
    "paths": {
      "@/*": [
        "src/*"
      ]
    }
  },
  "exclude": [
    "node_modules",
    "build",
    "config",
    "dist",
    "static",
  ],
  "vueCompilerOptions": {
    "experimentalCompatMode": 2,
    "experimentalTemplateCompilerOptions": {
      "compatConfig": {
        "MODE": 2
      }
    }
  }
}
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