一、报错

1、idea里报错

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

2、脚手架编译报错

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

二、原因

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

解决方案

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

三、效果如下:

完美解决。

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

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

相关文章:

  • 2021-09-12
  • 2021-04-06
  • 2021-11-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-11-19
  • 2022-12-23
相关资源
相似解决方案