1. 前端项目通常会用@/来做为别名,映射路径src/
    2. 别名缺点:在引用文件的时候,无法通过.来唤起路径提示
    3. 在项目根目录下,添加一个jsconfig.json文件,内容如下
      1. 解决vscode使用了@别名后路径不提示的问题
    4. jsconfig.json配置参考 https://code.visualstudio.com/docs/languages/jsconfig
      1. {
      2. "compilerOptions": {
      3. "emitDecoratorMetadata": true,
      4. "experimentalDecorators": true,
      5. "baseUrl": "./",
      6. "paths": {
      7. "@@/*": ["./*"],
      8. "@/*": ["src/*"],
      9. "@assets/*": ["src/assets/*"],
      10. "@constants/*": ["src/constants/*"],
      11. "@components/*": ["src/components/*"],
      12. "@hooks/*": ["src/hooks/*"],
      13. "@routes/*": ["src/routes/*"],
      14. "@models/*": ["src/models/*"],
      15. "@locales/*": ["src/locales/*"],
      16. "@utils/*": ["src/utils/*"]
      17. },
      18. "target": "ES6",
      19. "module": "commonjs",
      20. "allowSyntheticDefaultImports": true
      21. },
      22. "include": ["src/**/*"],
      23. "exclude": ["node_modules", "build"]
      24. }