vscode Vue 中 ts import 报错

422 阅读1分钟

b5440e437eadd3d3ce6d21601040494.png

大概描述如下:

Already included file name ... differs from file name ... only in casing.
The file is in the program because:
Imported via ...
Root file specified for compilation

解决方案

我参考了这个 链接

tsconfig.json 中添加如下代码

"forceConsistentCasingInFileNames": false,

不过有趣的是,我后面把它注释后,发现原本红线的地方又恢复正常了.....

所以可以先考虑重启vscode看看