Vue Bridge (for Vue v3)
@module-federation/bridge-vue3 provides a bridge utility function for Vue V3 applications. The provided createBridgeComponent can be used to export application-level modules, and createRemoteAppComponent can be used to load application-level modules.
Installation
Type
Example
Remote
Host
Parameters
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: