Skip to content

Vue-Integration

Asynchrone Komponenten

ts
// remote-components.ts
import { defineAsyncComponent } from 'vue'
import { loadRemote } from '@stratton-cologne/remote-modules'

export const RemoteUserProfile = defineAsyncComponent(async () => {
  const mod = await loadRemote('ui-profile')
  return mod.UserProfile
})

Routen dynamisch erweitern

ts
import type { RouteRecordRaw } from 'vue-router'
import { loadRemote } from '@stratton-cologne/remote-modules'

export async function getRemoteRoutes(): Promise<RouteRecordRaw[]> {
  const { Routes } = await loadRemote('admin-extra')
  return Routes
}