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