我的主包中的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
s***@firstsing.info (作者)
https://blog.csdn.net/m0_49407241/article/details/137116973我看的这个教程
2025-06-12 16:52
s***@firstsing.info (作者)
嗯正确的
2025-06-12 17:06