Vscode开发vue+ts项目 报错:找不到模块或其相应的类型声明
报错:找不到模块或其相应的类型声明。(Vue 3 can not find module)
报错原因:typescript 只能理解 .ts 文件,无法理解 .vue文件
解决方法:在项目根目录下创建一个后缀为 vue.d.ts 的文件,并写入以下内容:
1 | |
然后在tsconfig.json中写入一下内容:
1 | |
Vscode开发vue+ts项目 报错:找不到模块或其相应的类型声明
https://xmas-nnnut.github.io/2023/06/25/Vscode开发ts项目-报错:找不到模块或其相应的类型声明/