did you register the component correctly? For recursive components, make sure to provide the “name” option.

组件报错 did you register the component correctly? For recursive components, make sure to prov…

组件报错 did you register the component correctly? For recursive components, make sure to provide the “name” option.

下面是详细报错:

1
2
3
4
5
6
7
vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: <collection> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

found in

---> <Aaa> at src/views/template.vue
       <App> at src/App.vue
         <Root>

翻译的意思就是:未知的自定义元素:—您是否正确注册了该组件?对于递归组件,请确保提供“name”选项。

我仔细检查以后发现,
我在组件中添加了nmae属性还是报错。
发现问题出在下面,(copy的代码,没删除花括号导致报错)

1
import { collection } from '@/components/exam_center/collection'

删除即可,正确写法:

1
[cc lang='javascript']import { collection } from '@/components/exam_center/collection'

[/cc]

作者: huanggr

为您推荐

发表评论

电子邮件地址不会被公开。 必填项已用*标注