diff --git a/apps/host/app/app.vue b/apps/host/app/app.vue index b457ed5..9b2e6ff 100644 --- a/apps/host/app/app.vue +++ b/apps/host/app/app.vue @@ -1,6 +1,8 @@ @@ -11,13 +13,15 @@ import HostSsrComponent from "./components/HostSsrComponent.vue"; - + Loading remote widget... - + + Slot from host + Loading remote counter... diff --git a/apps/remote/app/app.vue b/apps/remote/app/app.vue index 6611ee6..94f56cb 100644 --- a/apps/remote/app/app.vue +++ b/apps/remote/app/app.vue @@ -1,3 +1,3 @@ - + diff --git a/apps/remote/app/components/exposed/Counter.vue b/apps/remote/app/components/exposed/Counter.vue index 4928382..850aa58 100644 --- a/apps/remote/app/components/exposed/Counter.vue +++ b/apps/remote/app/components/exposed/Counter.vue @@ -2,6 +2,10 @@ const count = ref(0); const hydrated = ref(false); +const slots = defineSlots<{ + footer(): any; +}>(); + onMounted(() => { hydrated.value = true; }); @@ -48,6 +52,7 @@ onMounted(() => { > Remote counter: {{ count }} + Default footer +interface Props { + message: string; +} + +defineProps(); + const count = ref(0); const hydrated = ref(false); @@ -22,6 +28,7 @@ onMounted(() => { " data-e2e="APP__CARD" > + Message: {{ message }} ` - declare module ${JSON.stringify(component.importPath)} { - const component: Component; - export default component; - } - `, - ) - .join("\n")} - - declare module "vue" { - export interface GlobalComponents { - ${components - .map((component) => `${component.componentName}: Component;`) - .join("\n")} - } - } + return `declare module "vue" { + export interface GlobalComponents { + ${components + .map( + (component) => + `${component.componentName}: typeof import("../../../${component.remoteName}/.nuxt/components.d.ts")["${component.exposedName}"];`, + ) + .join("\n\t\t")} + } +} - export {}; - `; +export { };`; }, }); }