无法找到模块“../views/index/Index.vue”的声明文件。“d:/source/m-apps1/m-demo1-pinia/vue-project/src/views/index/Index.vue”隐式拥有 "any" 类型。ts(7016)
解决方案:
env.d.ts:
/// <reference types="vite/client" />
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;
}
参考链接:
https://www.jianshu.com/p/6099eb9875fd
人工智能学习网站