微信小程序——自定义组件时,编译报`Component is not found in path ‘…’`
问题描述:
在微信小程序中自定义组件时,编译报Component is not found in path ‘...‘
解决方法:
确认自定义的组件的js文件是否存在Component构造器
Component({
});
确保要引入的页面的json文件中的usingComponents的path是正确的:
这里的路路径有两种写法:
{
"usingComponents": {
"watermark" : "/components/watermark/watermark"
}
}
{
"usingComponents": {
"watermark": "../../components/watermark/watermark"
}
}
微信小程序——自定义组件时,编译报`Component is not found in path '...'`
原文:https://www.cnblogs.com/wj365794/p/15210931.html
THE END
二维码