做项目时遇到使用循环组件,因为模式一样,只有数据不一样。但是按照普通的组件调用格式来做时报错,错误信息为 Unknown custom element : – did you re gis ter the component cor rect ly ? For recursive component s, make sure to provide the “name” option. 查询了官方文档,还有其他的资料,发现是循环调用组件时,组件比vue实例后创建,官方文档里写组件必须先于实例化引入,所以说组件没有正确的引入。 解决的方式是全局引入组件,并且在vue实例化前。 具体代码如下:若在项目中
did you re gis ter the component cor rect ly ? For recursive component s, make sure to provide the “name“
报错 Unknown custom element : <组件名> - did you re gis ter the component cor rect ly ?的原因及解决办法
出现 Unknown custom element : <> - did you re gis ter the component cor rect ly ? For recursive compon 检查以下几处 第一种: 看 component s:{},单词是否拼错,和不要写成 component s(){} 第二种:本页面 component s 看写了几个, 是否是因为覆盖了。只能有一个 component s:{} 第三种,检查引入的组件 确定是否需要{} , import XXX from "...." 还是 imp.
component s写成了 component import xxx from “./xxx.vue” 写成了import { xxx} from “./xxx.vue” 代码中有两个 component s,后一个的值把前一个覆盖了 逐一对照上述3种可能导致出错原因,然后做对应修改即可解决问题 我是第3个原因,被坑到差点怀疑人生,看到这篇文章的小伙伴你是什么原因?
Unknown custom element : - did you re gis ter the component cor rect ly ? For recursive component s, make sure to provide the “name” option. 出现这种报错,你需要排查:(仅供vue脚手架使用者参考) 1、是否引入模板文件 2、 component s是否拼写错误 3、是否已经...
在vue项目中,使用 element -ui抽屉组件的时候报了下面这个错误 但是前面使用的表格,表单,输入框一切正常,当引入drawer的时候就报错了。应该是vue或者 element UI版本过低的问题。 解决:找到了package.json文件,发现里面的 element 的版本过低。 然后需要升级 element -ui版本 解决 :npm 安装指定版本的 element -ui 比如:npm i el eme...
今天在引用Vue组件时报错 Unknown custom element : - did you re gis ter the component cor rect ly ? For recursive component s, make sure to provide the “name” option. 找了半天原因原来是import的时候出错了,多加了{ } 花括号 错误代码 import ...
场景:在vue项目中用 element -ui开发项目时出现这种情况,报错:[Vue warn]: Unknown custom element : - did you re gis ter the component cor rect ly ? For recursive component s, make sure to provide the “name” option. 页面显示不出来,如下: 原因:是因为我们没有注册组件导致的 解决办法: 在入口文件中注册即可,一般是main.js import { 解决 Vue 重复点击相同路由,出现 Uncaught (in promise) NavigationDuplicated: Avoided redundant navigation 问题 47828