[Vue warn]: Unknown custom element: <mycom> - did you register the component correctly? For recursiv
问题
最近在写一个前后端分离的项目,结果发现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相关推荐
- [Vue warn]: Unknown custom element: <Top> - did you register the component correctly?
[Vue warn]: Unknown custom element: - did you register the component correctly? 错误如下: 出现错误的原因有以下几种: ...
- [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 ...
- 解决[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 ...
- 【 已解决】[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 ...
- [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 ...
- 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 ...
- vue.js:634 [Vue warn]: Unknown custom element: <router-link> - did you register the component correc
今天第一次学习VueRouter就出了一个坑让我弄了两个小时 报错如下 代码如下 <div id="app"><!--router-link来指定跳转的路径--& ...
- 使用组件不渲染 Unknown custom element: <xxx> - did you register the component correctly? For recursiv
使用组件偶尔会出现组件不渲染,报错的情况 可能出现的错误,是因为element-ui没有注册 解决方法: 在main.js/main.ts中下载并注册 有的小伙伴儿,可能会由于自己封装从而改变样式 那 ...
- unknown custom element: <router-link> - did you register the component correctly? For recursiv
问题分析:你的<router-link />没有注册,也就是说demo中的router没有使用. 排查原因:仔细检查代码有没有引用所需组件. 代码里面没有引用..... 赶紧加上 到此,问 ...
最新文章
- linux tracepoint例子,tracepoint介绍
- .NET手记-JS获取Url参数
- 使用JFlex生成词法分析器 1:安装配置
- CRTMPServer 在CentOS 64-bit下的编译(转)
- nginx开发(二)配置mp4文件在线播放
- 循环队列 - 顺序存储结构
- 动态规划-最大的正方形面积
- jpeg图片转换成word
- linux通用内核,重新编译内核 - Linux通用系统优化大全_Linux教程_Linux公社-Linux系统门户网站...
- 曼彻斯特编码_网络工程师考点集锦(数字编码和编码效率)
- 艾宾浩斯记单词 记忆周期时间表
- 【工具】(一):关于Sublime Text 3,主题插件Boxy Theme安装问题,已解决
- 动手实现简易端口扫描器——PortScanner
- 重装系统(纯净系统)win7/win10
- 闲扯资管创新1:短债基金和摊余成本法定开债基
- L1-035 情人节
- C语言实现任意函数求不定积分
- agv ti 毫米波雷达_自动驾驶之——毫米波雷达概述
- YTU 3090 团体操排序
- MySQL项目:银行ATM存取款机系统