我用 webstorm 开发 electron + vue 的项目,已经在 vite 配置文件中设置了 @router,可以正常运行,但是看着报红线太碍眼,如何能去掉这个报红线?
我用 webstorm 开发 electron + vue 的项目,已经在 vite 配置文件中设置了 @router,可以正常运行,但是看着报红线太碍眼,如何能去掉这个报红线?
如果你使用 TypeScript,可以在 tsconfig.json 里手动添加 paths 配置
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"@router/*": ["src/renderer/src/router/*"]
}
}
}
然后 重启 WebStorm 以使其生效。
9 回答1.7k 阅读✓ 已解决
6 回答946 阅读
3 回答1.3k 阅读✓ 已解决
4 回答950 阅读✓ 已解决
2 回答1.1k 阅读✓ 已解决
3 回答858 阅读
3 回答1.3k 阅读✓ 已解决
tsconfig.json
里配下paths