Vue Bridge(for Vue v3)
@module-federation/bridge-vue3 提供了用于 Vue V3 应用的 bridge 工具函数,其提供的 createBridgeComponent 可用于导出应用级别模块,createRemoteAppComponent 用于加载应用级别模块。Demo
安装
类型
示例
Remote
Host
方法
createRemoteAppComponent
optionsloader- type:
() => Promise<Module> - Purpose: Used to load remote modules, e.g.,
loadRemote('remote1/export-app')orimport('remote1/export-app')
- type:
export- type:
string - Purpose: Used to specify module export
- type:
asyncComponentOptions- type:
Omit<AsyncComponentOptions, 'loader'> - Purpose: Parameters that will be passed to defineAsyncComponent, except for the loader parameter
- type:
rootAttrs- type:
Record<string, unknown> - Purpose: Attributes that will be bound to the root container where the remote Vue application will be mounted
- type:
- ReturnType
- type:
VueComponent - Purpose: Used to render remote module components
- type:
createBridgeComponent
bridgeInfo- type:
{ rootComponent: VueComponent; appOptions?: (params: AddOptionsFnParams) => ({ router?: Router }) } - Purpose: Used to pass the root component
- type:
- ReturnType
- type:
() => { render: (info: RenderFnParams) => void; destroy: (info: { dom: HTMLElement}) => void; }
- type: