解决方法:
1、在src根目录下创建一个文件env.d.ts的文件
2、在文件上写上以下内容:
declare module '*.vue' {
import type { DefineComponent } from 'vue'
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/ban-types
const component: DefineComponent<{}, {}, any>
export default component
}
注:文件名可以为其它,只要后缀为.d.ts即可。