File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 22import { RouterView } from " @kitbag/router" ;
33import Layout from " @/components/layout/Layout.vue" ;
44import ErrorBoundary from " @/components/handlers/ErrorBoundary.vue" ;
5+ import { createInstance } from " @module-federation/enhanced/runtime" ;
6+ import { defineAsyncComponent } from " vue" ;
7+
8+ const mf = createInstance ({
9+ " name" : " mf_host" ,
10+ " remotes" : [],
11+ });
12+
13+ mf .registerRemotes ([
14+ {
15+ " name" : " remote1" ,
16+ " alias" : " remote-1" ,
17+ " entry" : " https://unpkg.com/module-federation-rslib-provider@latest/dist/mf/mf-manifest.json" ,
18+ },
19+ ]);
20+
21+ const Huh = defineAsyncComponent (async () => {
22+ const { MyButton } = await mf .loadRemote (" remote1" ) as { " MyButton" : unknown };
23+
24+ return {
25+ " default" : MyButton ,
26+ };
27+ });
528 </script >
629
730<template >
@@ -10,6 +33,7 @@ import ErrorBoundary from "@/components/handlers/ErrorBoundary.vue";
1033 <template #default >
1134 <Layout >
1235 <RouterView />
36+ <Huh />
1337 </Layout >
1438 </template >
1539
You can’t perform that action at this time.
0 commit comments