在src文件夹下创建一个shims-vue.d.ts并输入以下内容:
declare module '*.vue' {
import { ComponentOptions } from 'vue'
const componentOptions: ComponentOptions
export default componentOptions
}
参考链接vue3 报错解决:找不到模块或其相应的类型声明。(Vue 3 can not find module) - 知乎 (zhihu.com)