1、安装扩展工具“Path Intellisense”并设置:
"path-intellisense.mappings": {
"@": "${workspaceRoot}/src"
}
2、在项目package.json所在同级目录下创建文件jsconfig.json:
{
"compilerOptions": {
"target": "ES6",
"module": "commonjs",
"allowSyntheticDefaultImports": true,
"baseUrl": "./",
"paths": {
"@/*": ["src/*"]
}
},
"exclude": [
"node_modules"
]
}