最近改别人代码,引入模块报错,Vue报错——did you register the component correctly? For recursive components, make sure to provide the
好多朋友说:注册组件时报的错,原因是组件名称不能用大写
<div id="app">
<my-Com></my-Com>
</div>
<script src="vue.js"></script>
<script>
let Component = Vue.extend({
template:`
<div>你好6666</div>
`
});
Vue.component('my-Com',Component);
new Vue({
el:'#app',
data:{
}
});
把所有的my-Com改为my-com即可,
但是我不错在这个问题,问题依旧存在,
如果你也是这样,那么一起找一下,很可能是components多写了一个,放的位置在最后,很坑的,快去查一下吧!