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