Vue报错------did you register the component correctly? For recursive components, make sure to provide
Vue报错------did you register the component correctly? For recursive components, make sure to provide
·
今天在开发项目的时候遇到很大坑。项目报错did you register the component correctly? For recursive components, make sure to provide the “name” option.
在一般情况下使用,这样注册并没有问题
import Editors from '@/components/EmbedResourcesText'//
export default {
components: {
Editors,
},
}
但当这个组件被多个父组件同时调用了。 就会出现did you register the component correctly? For recursive components, make sure to provide the “name” option.报错
需要在components里面这样写引入
export default {
components: { Editors: () => import ('@/components/EmbedResourcesText') }
}
报错就会消失 问题得到解决
更多推荐
所有评论(0)