s***@firstsing.info
s***@firstsing.info
  • 发布:2025-06-12 15:55
  • 更新:2025-06-30 14:18
  • 阅读:137

Component is not found in path xxxxxx may be missing corresponding "componentPlaceholder" option?

分类:uni-app

我的主包中的index页面要用到子包中的一个组件,然后我按照路径导入后并在index页面注册,还有pages.json中配置了usingComponents和componentPlaceholder然而还是报错:Component is not found in path xxxxxx may be missing corresponding "componentPlaceholder" option?

//pages.json  
   {  
      "path": "pages/index/index",  
      "style": {  
        "navigationBarTitleText": "xxxx,  
        "navigationStyle": "custom",  
        "navigationBarTextStyle": "white",  
        "usingComponents": {  
            "DaDropdownVue":"/pagesC/components/da-dropdown-vue/index"  
        },  
        "componentPlaceholder":{  
            "DaDropdownVue":"view"    
        }  
      }  
    },
//src/pages/index/index  
import DaDropdownVue from '@/pagesC/components/da-dropdown-vue/index.vue'  
export default {   
  components: {  
    content,  
    DaDropdownVue,  
    uNoNetwork,  
    uniEasyinput  
  },
src/  
└─ pagesC/  
   └─ components/  
      └─ da-dropdown-vue/  
         ├─ components/  
         ├─ index.vue  
         └─ utils.js
2025-06-12 15:55 负责人:无 分享
已邀请:
DCloud_UNI_yuhe

DCloud_UNI_yuhe

主包不能够引入分包的内容

1***@163.com

1***@163.com

我也遇到了同样问题,占位组件名不要使用驼峰使用下划线。
"componentPlaceholder":{
"DaDropdownVue":"view"
}
改为
"componentPlaceholder":{
"da-dropdown-vue":"view"
}

要回复问题请先登录注册