使用element-plus & naive-ui 自动导入 components.d.ts 找不到模块

2,766 阅读1分钟

在vite的时候总会自动引用自己编写的*.vue文件,然后提示:找不到模块.... 问题在的答案在于配置,解决方案就是把vs code中的ts自带配置给关喽!

  1. Run Extensions: Show Built-in Extensions(查看 -> 命令面板) from VS Code's command palette, look for TypeScript and JavaScript Language Features, then right click and select Disable (Workspace). By default, Take Over mode will enable itself if the default TypeScript extension is disabled.
  2. Reload the VS Code window by running Developer: Reload Window from the command palette. 以上两个两骤来源于vite vue-ts 中的readme.md文件。