Unknown custom element: <add-employee> - did you register the component correctly? For red cursive c

简介: 原因:1.组件名没写对(导入和注册不对应)2.components少写了个s3.组件命名最好是驼峰命名4.导入时语法错误5.代码中有两个components,后一个的值把前一个覆盖了6.组件直接循环套用了

5cbedef1644347b9ae08398b42847669.png


原因:

1.组件名没写对(导入和注册不对应)

2.components少写了个s

3.组件命名最好是驼峰命名

4.导入时语法错误

5.代码中有两个components,后一个的值把前一个覆盖了

6.组件直接循环套用了


解决方法:


本地注册组件可以用webpack的异步import


components: {
TreeFolderContents: () => import('./tree-folder-contents.vue')
}


相关文章
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
Error: Element type is invalid: expected a string (for built-in components) or a class/function
2312 0
【已解决】Error: Element type is invalid: expected a string (for built-in components) or a class/function
|
5月前
|
JavaScript
[Vue warn]: Unknown custom element: <Top> - did you register the component correctly?
[Vue warn]: Unknown custom element: <Top> - did you register the component correctly?
|
4月前
|
JavaScript
[Vue warn]: Method “components“ has type “object“ in the component definition. Did you reference the
[Vue warn]: Method “components“ has type “object“ in the component definition. Did you reference the
|
Linux
解决办法:error: <item> inner element must either be a resource reference or empty.
解决办法:error: <item> inner element must either be a resource reference or empty.
210 0
No injector for custom defined data type的解决办法
No injector for custom defined data type的解决办法
224 0
No injector for custom defined data type的解决办法
custom field further usage - add into UI and report
custom field further usage - add into UI and report
113 0
custom field further usage - add into UI and report
|
Java
Hybris DDIC type and its counterpart model class
Hybris DDIC type and its counterpart model class
110 0
Hybris DDIC type and its counterpart model class
|
XML Java 数据库连接
Open quote is expected for attribute "{1}" associated with an element type "id".
Open quote is expected for attribute "{1}" associated with an element type "id".
154 0
Open quote is expected for attribute "{1}" associated with an element type "id".
component set load logic - why coms_pcat_bob is accessed during product search
component set load logic - why coms_pcat_bob is accessed during product search
111 0
component set load logic - why coms_pcat_bob is accessed during product search
OPA 15 - find existing item by its type.note
Created by Wang, Jerry, last modified on Nov 08, 2015
124 0
OPA 15 - find existing item by its type.note