Bootstrap

vue中@符添加提示

vue中@符添加提示

在做vue项目的时候我们常用 @ 符来表示路径 src 但是@符没有提示使我们非常的苦恼


安装插件:Path Intellisense插件 在配置扩展设置中添加

"path-intellisense.mappings": {
      "@": "${workspaceRoot}/src"
   }

在项目package.json所在同级目录下创建文件jsconfig.json:

{
    "compilerOptions": {
        "target": "ES6",
        "module": "commonjs",
        "allowSyntheticDefaultImports": true,
        "baseUrl": "./",
        "paths": {
          "@/*": ["src/*"]
        }
    },
    "exclude": [
        "node_modules"
    ]
}

在.gitignore文件中添加jsconfig.json文件防止上传到远程仓库

;