1. 安装Path Intellisense插件

VSCode配置Import@路径

2. 设置插件

VSCode配置Import@路径


VSCode配置Import@路径

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

3. 项目目录增加jsconfig.json

{
    "compilerOptions": {
      	"baseUrl": "./",
        "paths": {
          "@/*": ["src/*"]
        }
    },
    "exclude": [
        "node_modules"
    ]
}


最后,如果不希望提交到代码仓库,可以使用.gitignore忽略掉

4. webstorm的设置方法

node_modules/@vue/cli-service/webpack.config.js 
VSCode配置Import@路径

相关文章:

  • 2022-12-23
  • 2021-12-24
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2022-01-29
  • 2021-05-20
  • 2021-06-13
猜你喜欢
  • 2021-12-10
  • 2022-12-23
  • 2021-06-24
  • 2022-12-23
  • 2021-08-04
  • 2021-12-10
相关资源
相似解决方案