vscode路径提示插件Path Intellisense不生效
2021-02-07 本文已影响0人
Sun____
一、安装配置
在应用商店搜索Path Intellisense然后安装,安装之后需要配置


点击设置按钮,在下拉列表中点击--扩展设置 选项,然后打开setting.json文件

在文件中添加配置
"path-intellisense.mappings": {
"@": "${workspaceRoot}/src",
"/": "${workspaceRoot}/"
}
到这里还没有结束,还要在package.json的同级文件添加jsconfig.json文件,加上以下配置:
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"paths": {
"@/*": [
"src/*"
]
}
},
"exclude": [
"node_modules"
]
}
全都配置完会后发现在vue文件里还不会出现路径提示,查了资料有的说是插件版本的问题
二、降低版本
同样在插件里点击设置按钮

下拉列表里选择--‘安装另一个版本...’,然后选择1.4.2,重启vscode就可以了
