icestark
icestark copied to clipboard
vue中中心化注册模块和使用模块的问题
Do you want to request a feature or report a bug? 期望在vue中使用时也可以像在react中,在入口处register,使用时通过moduleName进行使用
What is the current behavior? 目前在react中的中心化注册,可以通过在入口registerModule,使用时MicroModule传入moduleName实现 但在vue中,只能逐个信息通过mountModule注册,或通过registerModule中心化注册后,在getModules时代码中手动筛选
** if possible a minimal demo for the issue.**
开个getModuleInfo的API口子就行,实现逻辑就是
function getModuleInfo(moduleName: string) { return getModules().filter(m => m.name === moduleName)[0] }
这样就可以将原本写在代码里硬编码获取的moduleInfo内置了
参考文档 API 支持中心化能力,只不过针对 vue 技术栈没有提供出对应的组件渲染方式,需要自行设计下