问题

最近在写一个前后端分离的项目,结果发现VUE忘得差不多了,回头回顾下,结果复习到组件就把我卡了半天
错误代码如下:

<!DOCTYPE html>
<html><head><meta charset="utf-8" /><title></title><script src="js/vue.js" type="text/javascript" charset="utf-8"></script></head><body><div id="app"><myCom></myCom></div><template id="myTem"><p>{{datas}}</p></template><script>Vue.component('myCom', {template: "#myTem",data: function() {return {datas: 1}}})var app = new Vue({el: '#app',})</script></body></html>

错误如下:

解决方案

无语的很,就是因为在注册组件时,组件名有大写字母,就不行,十分的严格。

         Vue.component('mycom', {  //改成com就行template: "#myTem",data: function() {return {datas: 1}}})

将myCom改成mycom即可。

[Vue warn]: Unknown custom element: <mycom> - did you register the component correctly? For recursiv相关推荐

  1. [Vue warn]: Unknown custom element: <Top> - did you register the component correctly?

    [Vue warn]: Unknown custom element: - did you register the component correctly? 错误如下: 出现错误的原因有以下几种: ...

  2. [Vue warn]: Unknown custom element: <helptext> - did you register the component correctly? For recu

    报错信息: vue.js:634 [Vue warn]: Unknown custom element: - did you register the component correctly? For ...

  3. 解决[Vue warn]: Unknown custom element: <ag> - did you register the component correctly? For recursive

    [Vue warn]: Unknown custom element: <ag> - did you register the component correctly? For recur ...

  4. 【 已解决】[Vue warn]:Unknown custom element: <a-calendar> - did you register the component correctly

    [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive compon ...

  5. [Vue warn]: Unknown custom element: <rules-set> - did you register the component correctly? For recu

    1.使用父子组件时,报错 2.子组件未引入 import rulesSet from "./components/rulesSet.vue" components: {rulesS ...

  6. Vue报错-[Vue warn]: Unknown custom element: <van-action-sheet> - did you register the component correc

    项目场景: 今天在使用到vant组件的时候引入报错. [Vue warn]: Unknown custom element: <van-action-sheet> - did you re ...

  7. vue.js:634 [Vue warn]: Unknown custom element: <router-link> - did you register the component correc

    今天第一次学习VueRouter就出了一个坑让我弄了两个小时 报错如下 代码如下 <div id="app"><!--router-link来指定跳转的路径--& ...

  8. 使用组件不渲染 Unknown custom element: <xxx> - did you register the component correctly? For recursiv

    使用组件偶尔会出现组件不渲染,报错的情况 可能出现的错误,是因为element-ui没有注册 解决方法: 在main.js/main.ts中下载并注册 有的小伙伴儿,可能会由于自己封装从而改变样式 那 ...

  9. unknown custom element: <router-link> - did you register the component correctly? For recursiv

    问题分析:你的<router-link />没有注册,也就是说demo中的router没有使用. 排查原因:仔细检查代码有没有引用所需组件. 代码里面没有引用..... 赶紧加上 到此,问 ...

最新文章

  1. linux tracepoint例子,tracepoint介绍
  2. .NET手记-JS获取Url参数
  3. 使用JFlex生成词法分析器 1:安装配置
  4. CRTMPServer 在CentOS 64-bit下的编译(转)
  5. nginx开发(二)配置mp4文件在线播放
  6. 循环队列 - 顺序存储结构
  7. 动态规划-最大的正方形面积
  8. jpeg图片转换成word
  9. linux通用内核,重新编译内核 - Linux通用系统优化大全_Linux教程_Linux公社-Linux系统门户网站...
  10. 曼彻斯特编码_网络工程师考点集锦(数字编码和编码效率)
  11. 艾宾浩斯记单词 记忆周期时间表
  12. 【工具】(一):关于Sublime Text 3,主题插件Boxy Theme安装问题,已解决
  13. 动手实现简易端口扫描器——PortScanner
  14. 重装系统(纯净系统)win7/win10
  15. 闲扯资管创新1:短债基金和摊余成本法定开债基
  16. L1-035 情人节
  17. C语言实现任意函数求不定积分
  18. agv ti 毫米波雷达_自动驾驶之——毫米波雷达概述
  19. YTU 3090 团体操排序
  20. MySQL项目:银行ATM存取款机系统

热门文章

  1. 服务器更新宕机-自我检讨
  2. 【drawio笔记】向ERD表,列表和UML类添加行
  3. 03-lvs-persistence
  4. vba英文翻译成中文
  5. 海康威视摄像头存储到电脑硬盘
  6. 微型计算机简单并行接口实验心得,实验二 简单并行接口
  7. 数据结构课程设计(八)---家谱管理系统(十几个功能)
  8. Java将对象的属性值合并
  9. 多线程实现生产者与消费者模式
  10. 局域网与城域网 - 以太网标准(百兆 100Base、千兆 1000Base、万兆 10GBase)