vscode 编辑器识别 vue 中的 @ 路径

1120环境配置kohai

首先在项目根目录下新建一个 jsconfig.json 的文件,然后输入以下内容:

{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": [
        "src/*"
      ]
    },
    "target": "ES6",
    "module": "commonjs",
    "allowSyntheticDefaultImports": true
  },
  "include": [
    "src/**/*"
  ],
  "exclude": [
    "node_modules"
  ]
}
json
复制代码

之后在安装 Path Intellisense 插件即可。

编辑于:2021-07-04 12:17:40