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

三、效果如下:

完美解決。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM