跳到主要内容
青山指南正在为您准备页面
医疗级专业核验
透明收费 · 拒绝隐形 每天 08:00-20:00
资讯

使用vue3+TS提示模块无法找到。

养老服务、照护经验与行业动态,为家庭提供实用参考。

使用vue3+TS提示模块无法找到。

创建页面也可以正常访问,但是ts报错找不不到模块,可以尝试使用下面方法解决

1.在根目录下面创建 shims-vue.d.ts ,放入下面代码,如果第二和代码段不行,可以尝试第一个。


// declare module '*.vue' {
//     import type { DefineComponent } from 'vue'
//     const component: DefineComponent<{}, {}, any>
//     export default component
// }

declare module '*.vue' {
    import type { DefineComponent } from 'vue'
    const component: ComponentOptions | ComponentOptions['setup']
    export default component
}
咨询顾问返回首页
分享经验

发表评论

读者交流

全部评论

0

还没有评论,欢迎留下第一条讨论。