解决Vue3引入自定义组件报错Cannot find module ‘xxx‘ or its corresponding type declarations问题

一、报错

1、idea里报错

2、脚手架编译报错

二、原因

声明都没有问题,为什么还会报错? 是因为import的地址不对。

解决方案

import TheHeader from '../components/the-header.vue';
import TheFooter from "../components/the-footer.vue";
import TheSider from "../components/the-sider.vue";

三、效果如下:

完美解决。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章