Unknown custom element: <di> - did you register the component correctly? For recursive components, m

在这里插入图片描述
这个报错是组件内有标签打错了,浏览器无法识别,需要好好找下,我就是把div打成了di所以报错,找了很久。
还有一种类似的情况,但是解决起来完全不一样,这是我看的别人的方法,自己暂时还没有遇到,这种情况也要注意

报错Unknown custom element: <组件名> - did you register the component correctly?
出现的原因

第一种: 看 components:{
    
    },单词是否拼错,和不要写成components(){
    
    }
第二种:本页面components 看写了几个, 是否是因为覆盖了。只能有一个components:{
    
    }

第三种,检查引入的组件 确定是否需要{
    
    } ,
 import XXX from "...." 还是 import {
    
     XXX } from "...."

猜你喜欢

转载自blog.csdn.net/Maxueyingying/article/details/131203781