今天在Vue.js的组件化开发学习时,发现组件命名中含大写,调用组件时报错的问题,具体如下:
代码图
报错:Unknown custom element: <cpnc> - did you register the component correctly? For recursive components, make sure to provide the "name" option
根据提示,没有注册“cpnc”,
具体错误原因分析:因为js中时严格区别大小写,而html中时不区分大小写的,所以html中提示没有注册’cpnc‘
后续将js中的cpnC改为cpnc即可







网友评论