小程序插件封装Component报错 Component is not found in path……或 component is not defined

小程序插件封装Component报错

小白程序猿,小程序在封装插件的时候遇到 Component报错,解决方式。

# 提示为Component is not found in path……解决方式:排查路径

  • 引用组件文件的引用路径有问题,改路径就好了
  1. 先核对路径的各个文件的名字
  2. …/ 相对路径写错了

相对路径写不明白的小白程序猿,可以查看这个链接文章(https://blog.csdn.net/qq_34769573/article/details/80445681 此链接来自RocksLee.)

错误示例:在这里插入图片描述

# 出现 component is not defined 报错

  • 组件的JS 文件下的Component开头首字母没大写

错误示例:
在这里插入图片描述

正确示例:
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/xff_xiaofanfan/article/details/105320303