之前用过的组件没有出现过任何问题,但偏偏在其他目录下引用就出问题了。组件的名称、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. 使用GitHub绑定域名免费创建自己的博客

    通过GitHub创建一个免费的.有上传网页功能的.可以绑定域名的个人博客,或者网站. 在这之前的必要条件: 1.有自己的域名,能添加CNAME或者A记录 2.注册好了GitHub账号 方法: 1.添加 ...

  2. sed -i 's/Search_String/Replacement_String/g' Input_File sed详细手册

    本文列出的十五个例子可以帮助你掌握 sed 命令.如果要使用 sed 命令删除文件中的行,去下面的文章.注意:由于这是一篇演示文章,我们使用不带 -i 选项的 sed 命令,该选项会在 Linux 终 ...

  3. 如何在CentOS 7上安装Htop

    在本教程中,我们将向您介绍如何在CentOS 7服务器上安装和配置Htop.对于那些不知道的人,Htop 是为Linux编写的一个交互式实时系统监视进程查看器.它被设计为替代Unix程序的顶部.它显示 ...

  4. CentOS 7 调整home大小

    把/home内容备份,然后将/home文件系统所在的逻辑卷删除,扩大/root文件系统,新建/home: tar cvf /tmp/home.tar /home #备份/home umount /ho ...

  5. Docker Swarm(六)Label 节点标签与服务约束

    前言 多节点 Swarm 集群下,可能节点的配置不同(比如 CPU.内存等),部署着不同类型的服务(比如 Web服务.Job服务等),当这些服务以 Service 或者 Stack 的形式部署到集群, ...

  6. Zabbix5.0服务端部署

    Zabbix5.0服务端部署 基础环境配置 [root@localhost ~]# systemctl disable --now firewalld Removed symlink /etc/sys ...

  7. Jira&Confluence服务器安装

    1.Mysql安装 参考https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html 创建相应的数据库 CREAT ...

  8. python文件处理(对比和筛选)

    #!/user/bin/python #!coding=utf-8 # -*- coding: utf-8 -*- # 2017-9-25 #author:jingwenshuai import sy ...

  9. 计划任务 at & crond tbc

    一次性任务 at 工具 由包 at 提供 依赖与atd服务,需要启动才能实现at任务 at队列存放在/var/spool/at目录中 执行任务时PATH变量的值和当前定义任务的用户身份一致 作业执行命 ...

  10. Go语言之main包

    Go语言的代码通过包(package)组织,包类似于其他语言里的库(libraries)或者模块(modules).一个包由位于单个目录下的一个或多个go源文件组成,目录定义包的作用.每个源文件都以一 ...