之前用过的组件没有出现过任何问题,但偏偏在其他目录下引用就出问题了。组件的名称、import的路径都没任何问题,发现这是因为组件name填写不规范所导致的

在定义组件的时候我们要严格按照官方文档要求来做,官方文档给出了两种组件的命名方式,即kabab-case和PascalCase。

1、kebab-case

Vue.component('my-component-name', { /* ... */ })

使用 kebab-case (短横线分隔命名) 定义一个组件时,也必须在引用这个自定义元素时使用 kebab-case,例如 <my-component-name>。

2、PascalCase

Vue.component('MyComponentName', { /* ... */ })

当使用 PascalCase (首字母大写命名) 定义一个组件时,在引用这个自定义元素时使用 <my-component-name> 或 <MyComponentName>。

Unknown custom element: <...> - did you register the component correct?的更多相关文章

  1. vue components registration & vue error & Unknown custom element

    vue components registration & vue error & Unknown custom element vue.esm.js:629 [Vue warn]: ...

  2. vue报错[Vue warn]: Unknown custom element: <router-Link> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

    vue浏览器报错,如下 vue.runtime.esm.js?2b0e:619 [Vue warn]: Unknown custom element: <router-Link> - di ...

  3. [Vue warn]: Unknown custom element: <sapn> - did you register the component correctly? For recursive components, make sure to provide the "name" option. found in ---> <Evaluate> at src/views/index/

    关于vue报错: [Vue warn]: Unknown custom element: <sapn> - did you register the component correctly ...

  4. Vue报错之" [Vue warn]: Unknown custom element: <wzwzihello> - did you register the component correctly? For recursive components, make sure to provide the "name" option."

    一.报错截图 [Vue warn]: Unknown custom element: <wzwzihello> - did you register the component corre ...

  5. 使用vue.js路由踩到的一个坑Unknown custom element

    在配合require.js使用vue路由的时候,遇到了路由组件报错: “vue.js:597 [Vue warn]: Unknown custom element: <router-link&g ...

  6. (错误记录)Vue: Unknown custom element

    错误: vue.js:634 [Vue warn]: Unknown custom element: <ve-pie> - did you register the component c ...

  7. 使用el-dialog时,报错“Unknown custom element:<el-dialog> did you register the component correctly?...make sure to provide the 'name' option”

    初学vue时,曾遇到一个无语的问题,在用el-dialog时一直显示没有导入,结果发现是因为没有把element ui引入到项目里. 需进行以下步骤: 1.执行: npm install elemen ...

  8. Unknown custom element: <componentName> - did you register the component correct?

    最近开发的时候遇见一个头疼的事情,之前用过的组件没有出现过任何问题,但偏偏在其他目录下引用就出问题了. 组件的名称.import的路径都没任何问题,看了其他人遇到的问题和官方文档关于组件name属性的 ...

  9. Vue报错——Unknown custom element: <shop-slide> - did you register the component correctly?

    参考: https://blog.csdn.net/jiangyu1013/article/details/85676292 解决:除了import组件外,还要在components中添加 <t ...

随机推荐

  1. K8S的资源管理

    K8S的资源管理 管理K8S资源的三种基本方法: 陈述式资源管理方法-使用cli工具进行管理. 声明式资源管理方式-主要依耐资源配置清单. GUI式资源管理方法-主要依耐图形界面. 陈述式资源管理方法 ...

  2. VMware vCenter重置web console SSO登录密码

    On a Windows Platform Services Controller or vCenter Server with Embedded Platform Services Controll ...

  3. 006.Python循环语句while循环

    循环结构 优点 减少代码冗余 提升效率 while循环 语法结构 while 条件表达式: 循环体 code1 code2 打印0-100 i = 0 while i <= 100: print ...

  4. shell初学之nginx(域名)

    创建两个以域名区分的虚拟网站: 1 #!/bin/bash 2 curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/ ...

  5. 将.netcore5.0(.net5)部署在Ubuntu的docker容器中

    环境:     宿主机:winows 10 家庭版     虚拟机管理软件:Hyper-V     虚拟机系统:Ubuntu 20.10     Docker版本:Docker CE 20.10.2 ...

  6. git push 时发生错误 error: src refspec master does not match any. error: failed to push some refs to

    很多相关解决办法都是最后要 push 到远端的 master 上,但很多其实要求不能把个人的修改内容直接 push 到 master 主分支. 因此,当我想将本地 feature/work1 分支的修 ...

  7. linux(centos 7)下安装JDK,Tomcat,mysql 运行Maven 项目

    一.在Linux中安装JDK 1. 将JDK上传到root下(任何位置均可以). 如图: 2. 用解压命令解压JDK tar -xvf (此处为jdk文件名) 如果是rpm包,执行rpm -i jdk ...

  8. java 集合梳理

    使用 processOn 画的java 集合图谱,应付面试应该可以了

  9. sql生成可读性逻辑图

    下面这张图是我自己画的sql逻辑图.规定了一些画法.然后画出来是这样的. 因为经常要读别人的sql,又臭又长,可读性很差,于是想做一个程序自动生成的逻辑图. 为什么不用执行语法树,因为个人觉得语法树可 ...

  10. HashMap源码:聊聊Map的遍历性能问题(一)

    目录 引言 迭代器测试 迭代器源码探究 其他遍历方法 增强型for循环 Map.forEach Stream.forEach 总结 附:四种遍历源码 附:完整测试类与测试结果+一个奇怪的问题 引言 今 ...