解決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";

三、效果如下:

完美解決。

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